To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.off-topic.debateOpen lugnet.off-topic.debate in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Off-Topic / Debate / 9146
9145  |  9147
Subject: 
Re: Not at all a pact with the devil...
Newsgroups: 
lugnet.off-topic.debate
Date: 
Mon, 29 Jan 2001 23:18:52 GMT
Viewed: 
474 times
  
In lugnet.off-topic.debate, Kevin Loch writes:
Of course that should be:

fixURL(char *buf) {
  int urlsize;

urlsize=strlen(buf);
if ((buf[urlsize]-1] != '/') && (urlsize < BUFSIZE-1)) {
  buf[urlsize]='/';
  buf[urlsize+1]=0;
}

Might wanna throw in a comment at the top stating that behavior is undefined
(and may even result in a segmentation fault) if fixURL(buf) is called when
*buf == "\0".  As written above, code assumes that strlen(buf) >= 1.

--Todd



Message has 1 Reply:
  Re: Not at all a pact with the devil...
 
(...) d'Oh. Shame on me. I mean when *buf == '\0'. :-) --Todd (24 years ago, 30-Jan-01, to lugnet.off-topic.debate)

Message is in Reply To:
  Re: Not at all a pact with the devil...
 
In lugnet.off-topic.debate, Kevin Loch writes: Of course that should be: fixURL(char *buf) { int urlsize; urlsize=strlen(buf); if ((buf[urlsize]-1] != '/') && (urlsize < BUFSIZE-1)) { buf[urlsize]='/'; buf[urlsize+1]=0; } (...) (24 years ago, 29-Jan-01, to lugnet.off-topic.debate)

45 Messages in This Thread:













Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR