freebsd/libc/rpc: Fix the fgets emulation for the internal netconfig support

This commit is contained in:
Chris Johns
2021-09-08 09:19:28 +10:00
parent b7c51ac449
commit 715e29f2a0

View File

@@ -93,8 +93,9 @@ nc_fgets(char * str, int size, FILE *stream) {
if (p == NULL)
return NULL;
l = strlen(p);
size = l < size ? l : size;
size = l < size ? l : size - 1;
memcpy(str, p, size);
str[size] = '\0';
++netconfig_next;
return str;
}