commit 2b7d11ed0ac110049760a34794686a0cd65071d6
parent 65c444328c354a3620bab5b37ceb157e6fad8f17
Author: Quentin Rameau <quinq@fifth.space>
Date: Wed, 27 May 2020 09:52:21 +0200
libc: Fix vfprintf numeric sign convertion
When the value is signed, the signed convertion needs to be used
instead of the "unrelevant" unsigned one.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libc/stdio/vfprintf.c b/src/libc/stdio/vfprintf.c
@@ -61,7 +61,7 @@ getnum(va_list *va, int flags, int *sign)
if ((flags & UNSIGNED) == 0 && val < 0) {
*sign = '-';
- uval = -uval;
+ uval = -val;
}
return uval;
}