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)
(...) 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 (24 years ago, 29-Jan-01, to lugnet.off-topic.debate)