[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH] lib/nolibc: Fix vsnprintf when size is zero



Hi Razvan,

oh, one more thing. Sorry this is coming in bits and pieces:

On 08/16/2018 04:43 PM, Razvan Rotaru wrote:
diff --git a/lib/nolibc/stdio.c b/lib/nolibc/stdio.c
index 7e3d368..c2e9f59 100644
--- a/lib/nolibc/stdio.c
+++ b/lib/nolibc/stdio.c
@@ -101,8 +101,9 @@ int vsnprintf(char *str, size_t size, const char *fmt, 
va_list ap)
  {
  #define PCHAR(c)                                                              
 \
        {                                                                      \
+               int cc = c;                                                    \

It probably makes sense to make this "int cc = (c);" Equality is already really low on the precedence list, but the comma is still lower, and better be safe than sorry, especially now that we're touching the code anyway.

Cheers,
Florian

--
Dr. Florian Schmidt
フローリアン・シュミット
Research Scientist,
Systems and Machine Learning Group
NEC Laboratories Europe
Kurfürsten-Anlage 36, D-69115 Heidelberg
Tel.     +49 (0)6221 4342-265
Fax:     +49 (0)6221 4342-155
e-mail:  florian.schmidt@xxxxxxxxx
============================================================
Registered at Amtsgericht Mannheim, Germany, HRB728558

_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.