void dump_hex(const char* data, char* buf, int datasize);
+/* Copy up to n chars from src to dest, stopping at the first newline
+ * and terminating dest with a NUL char. It is guaranteed that dest
+ * will not contain a newline and that strlen(dest) <= n. If src
+ * contains no newlines, dest will be an empty string. Caller must
+ * allocate n+1 chars for dest.
+get_till_eol(char *dest, const char *src, int n);