shithub: scc

Download patch

ref: 2b7d11ed0ac110049760a34794686a0cd65071d6
parent: 65c444328c354a3620bab5b37ceb157e6fad8f17
author: Quentin Rameau <[email protected]>
date: Wed May 27 05:52:21 EDT 2020

libc: Fix vfprintf numeric sign convertion

When the value is signed, the signed convertion needs to be used
instead of the "unrelevant" unsigned one.

--- a/src/libc/stdio/vfprintf.c
+++ b/src/libc/stdio/vfprintf.c
@@ -61,7 +61,7 @@
 
 	if ((flags & UNSIGNED) == 0 && val < 0) {
 		*sign = '-';
-		uval = -uval;
+		uval = -val;
 	}
 	return uval;
 }