1
0
mirror of https://github.com/systemd/systemd.git synced 2024-12-23 21:35:11 +03:00

*_id: fix zero length in set_str()

Thanks to Olaf Hering <olh@suse.de>

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
This commit is contained in:
Kay Sievers 2005-08-22 11:37:12 +02:00
parent 8c11a2f0ff
commit c907c823c3
4 changed files with 4 additions and 4 deletions

View File

@ -68,7 +68,7 @@ static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
while (isspace(from[len-1]))
while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */

View File

@ -107,7 +107,7 @@ static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
while (isspace(from[len-1]))
while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */

View File

@ -82,7 +82,7 @@ static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
while (isspace(from[len-1]))
while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */

View File

@ -66,7 +66,7 @@ static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
while (isspace(from[len-1]))
while (len && isspace(from[len-1]))
len--;
/* strip leading whitespace */