Thread (45 messages) 45 messages, 10 authors, 2016-09-28

Re: ISDN-Gigaset: Enclose two expressions for the sizeof operator by parentheses

flat view

From: SF Markus Elfring <hidden>
Date: 2016-09-26 18:00:32
Also in: kernel-janitors, lkml

quoted
@@ -53,7 +53,7 @@ void gigaset_dbg_buffer(enum debuglevel level, const unsigned char *msg,
 {
     unsigned char outbuf[80];
     unsigned char c;
-    size_t space = sizeof outbuf - 1;
+    size_t space = sizeof(outbuf - 1);
   What?! Does that compile?
Yes, of course. - The calculated value will be lower than intended.

Unfortunately, I stumbled on one of my own programming mistakes once again.


I sent a corrected update suggestion for further considerations a few minutes ago.

Regards,
Markus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help