Unix Technical Forum

distrust snprintf returnvalue

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 ...


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > lucky.openbsd.tech

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-22-2008, 11:26 AM
Han Boetes
 
Posts: n/a
Default distrust snprintf returnvalue

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 03:32 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com