Aug. 16th, 2019

dagibbs: (Default)
Who writes code that does:

sprintf(buf, "this is a constant string");
strcat(str, buf );


Over and over again.

Maybe the same person who writes code that does:
int cksum = 0;
// this is really simple
// just add all the bytes, modulo the MAX storable value
// in the cksum
for (i=0; i < len; i++)
	cksum += buf[i];

Or does:
 msg.flags = 0;
 if (flags & FLAG1) 
       msg.flags = FLAG1;
 if (flags & FLAG2) 
       msg.flags |= FLAG2;
 if (flags & FLAG3) 
       msg.flags |= FLAG3;
 if (flags & FLAG4) 
       msg.flags |= FLAG4;

// that should be one line:
msg.flags = flags & (FLAG1|FLAG2|FLAG3|FLAG4);


I am in pain. So much pain.

Profile

dagibbs: (Default)
dagibbs

April 2026

S M T W T F S
   1234
5678910 11
12131415161718
19202122232425
2627282930  

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 12th, 2026 07:58 pm
Powered by Dreamwidth Studios