[Xcb] New aux function

Jeremy Kolb jkolb at brandeis.edu
Sun Jan 15 11:50:33 PST 2006


I was thinking putting a new function in aux/convenient that takes a
string in a reply and returns a new string with a terminating null.

Something like:

char *XCBAuxExtractString(char *s, int n) {
    char *str;
    str = (char *)malloc(sizeof(char) * (n+1));
    strncpy(str, s, n);
    str[n] = '\0';
    return str;
}

Good/bad/ugly/thoughts?

Jeremy


More information about the Xcb mailing list