This is a discussion on distrust snprintf returnvalue within the lucky.openbsd.tech forums, part of the OpenBSD category; --> Hi, Did I get this right? Or is there something I'm missing? I mean I can easily produce a ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, Did I get this right? Or is there something I'm missing? I mean I can easily produce a lot more of these. Odd whitespacing BTW. Index: alias_irc.c ================================================== ================= RCS file: /cvs/src/usr.sbin/ppp/ppp/alias_irc.c,v retrieving revision 1.11 diff -u -p -r1.11 alias_irc.c --- alias_irc.c 15 Jun 2002 08:01:59 -0000 1.11 +++ alias_irc.c 13 Apr 2005 20:09:29 -0000 @@ -260,9 +260,10 @@ lFOUND_CTCP: #endif alias_address = GetAliasAddress(link); - n = snprintf(&newpacket[iCopy], + (void) snprintf(&newpacket[iCopy], sizeof(newpacket)-iCopy, "%lu ", (u_long)htonl(alias_address.s_addr)); + n = strlen(&newpacket[iCopy]); if( n < 0 ) { DBprintf(("DCC packet construct failure.\n")); goto lBAD_CTCP; # Han |
| Thread Tools | |
| Display Modes | |
|
|