return(0);
}
-
/**
* \brief Utility function to "readline" from memory
* \param start Location in memory from which we are reading.
int len = 0; /**< tally our own length to avoid strlen() delays */
ptr = start;
- memset(buf, 0, maxlen);
while (1) {
ch = *ptr++;
if ((len + 1 < (maxlen)) && (ch != 13) && (ch != 10)) {
buf[len++] = ch;
- buf[len] = 0;
}
if ((ch == 10) || (ch == 0)) {
+ buf[len] = 0;
return ptr;
}
}
+
/*
* Strip a boundarized substring out of a string (for example, remove
* parentheses and anything inside them).