Two things:
1) make it actually return the data
2) _ascii() and _unicode() will get invoked in some cases, and they need
to handle the case where they do nothing.
Signed-off-by: Peter Jones <pjones@redhat.com>
p[usedchars] = '\0';
}
+ if (!new_data)
+ return 0;
+
if (*data)
free(*data);
*data = (uint8_t *)new_data;
/ sizeof (*new_data);
}
+ if (!new_data)
+ return 0;
+
if (*data)
free(*data);
*data = (uint8_t *)new_data;
int fd = STDIN_FILENO;
ssize_t num_read=0;
unsigned long appended=0;
- size_t maxchars = 1024;
+ size_t maxchars = 0;
char *buffer;
if (!data) {
if (fd != STDIN_FILENO)
close(fd);
+ *data = (uint8_t *)buffer;
+ *data_size = appended;
+
return appended;
}