All pastes #60696 Raw Edit

Untitled

public c v1 · immutable
#60696 ·published 2006-06-01 18:27 UTC
rendered paste body
void dtioDisplay(const char *s, int row, int column, int length) {    char *new_string;    int s_len, i;    s_len = strlen(s);    if (length != 0) {        new_string = (char *)malloc(sizeof(char) * length);        strncpy(new_string, s, length);        if (s_len < length) {            for (i = s_len; i < length; i++) {                new_string[i] = ' ';            }        }        new_string[length] = '\0';    }    else {        new_string = (char*)malloc(sizeof(char) * s_len);        strncpy(new_string, s, s_len);    }    dtioCursor(row, column);    dtioPuts(new_string);    fprintf(stderr, "New string: %d@@\n", new_string);    free(new_string);}