Previously GNU libc supported the a option in scanf, e.g.
%as to allocate the buffer for the scanned string. The manual
recommends to use m instead as it follows the standard.
while (fgets(line, BUFSIZ, fp) != NULL) {
char *path;
char *scanned_path = NULL;
- if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %d %as",
+ if (sscanf(line, "%*x: %*x %*x %*x %*x %*d %d %ms",
&scanned_inode, &scanned_path) != 2) {
if (scanned_path)
free(scanned_path);
bptr++;
pr = malloc(sizeof(struct proc_info));
sscanf(bptr,
- "%a[^)]) "
+ "%m[^)]) "
"%c "
"%d %d %d %d %d %d"
"%lu %lu %lu %lu " /*flts*/