libc: Fix strcpy() assignment mistake
PATCH 1/1 libc: Fix strcpy() assignment mistake
From: Paul Semel <[email protected]>
the strcpy function was doing a comparison instead of doing an assignment.
Signed-off-by Paul Semel <[email protected]>
Reviewed-by Pawel Wieczorkiewicz <[email protected]>
Reviewed-by Bjoern Doebel <[email protected]>
Reviewed-by Martin Pohlack <[email protected]>
--- common/libc/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
common/libc/string.c +1 -1
@@ -24,7 +24,7 @@ size_t strnlen(const char *str, size_t max) {char *p = dst; -while ( *p++ == *src++ ) +while ( (*p++ = *src++) ) ;return dst;
Signature · 7 lines
1.8.3.1 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xen.org/xen-devel
Quoted 10 lines · Paul Semel
From: Paul Semel <[email protected]>
the strcpy function was doing a comparison instead of doing an assignment.
Signed-off-by Paul Semel <[email protected]>Reviewed-by Pawel Wieczorkiewicz <[email protected]>Reviewed-by Bjoern Doebel <[email protected]>Reviewed-by Martin Pohlack <[email protected]>
Oops. This issue is hidden due to __builtin_strcpy() optimising all in-tree callsites.
Reviewed-and-tested-by Andrew Cooper <[email protected]>, and
pushed.
common/libc/string.c size_t strnlen(const char *str, size_t max)
Quoted 9 lines
--- common/libc/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)common/libc/string.c +0
-0@@ -24,7 +24,7 @@ size_t strnlen(const char *str, size_t max)
It looks like git isn't terribly happy with the (strcpy) preprocessor trick. I did a double-take when I first read the patch.
~Andrew
common/libc/string.c size_t strnlen(const char *str, size_t max) · line 30
Quoted 8 lines
common/libc/string.c +1
-1{char *p = dst; -while ( *p++ == *src++ ) +while ( (*p++ = *src++) ) ;return dst;
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel