>>> Robert Story <[email protected]> schrieb am 08.11.2016 um 21:17 in
>>> Nachricht
<[email protected]>:
[...]
> So the strlen - 1 chops off the newline.
Actually it tries to remove the last character before '\0', even if there is
none. For safetly there should be a check for a zero-length string, because
otherwise bad things may happen.
I'd prefer
char *cp;
for (cp = tmpuf2; *cp != '\0'; ++cp)
if (*cp == '\n') {
*cp = '\0';
break;
}
}
because it does what you say, and nothing else.
Ulrich
------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders