mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-16 06:58:48 +08:00
freebsd/libc/rpc: Fix the fgets emulation for the internal netconfig support
This commit is contained in:
@@ -93,8 +93,9 @@ nc_fgets(char * str, int size, FILE *stream) {
|
|||||||
if (p == NULL)
|
if (p == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
l = strlen(p);
|
l = strlen(p);
|
||||||
size = l < size ? l : size;
|
size = l < size ? l : size - 1;
|
||||||
memcpy(str, p, size);
|
memcpy(str, p, size);
|
||||||
|
str[size] = '\0';
|
||||||
++netconfig_next;
|
++netconfig_next;
|
||||||
return str;
|
return str;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user