[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] put my fenceposts back in valid memory space
Update of /home2/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv10860
Modified Files:
directory.c
Log Message:
put my fenceposts back in valid memory space
Index: directory.c
===================================================================
RCS file: /home2/or/cvsroot/src/or/directory.c,v
retrieving revision 1.131
retrieving revision 1.132
diff -u -d -r1.131 -r1.132
--- directory.c 27 Sep 2004 06:00:43 -0000 1.131
+++ directory.c 27 Sep 2004 06:45:32 -0000 1.132
@@ -284,14 +284,13 @@
s = (char *)eat_whitespace_no_nl(s);
if (!*s) return -1;
start = s; /* this is it, assuming it's valid */
- s = (char *)find_whitespace(s);
+ s = (char *)find_whitespace(start);
if (!*s) return -1;
- *s = 0;
if(s-start < 5 || strcmpstart(start,"/tor/")) { /* need to rewrite it */
*url = tor_malloc(s - start + 5);
strcpy(*url,"/tor");
- strlcpy(*url+4, start, s-start+1);
- *url[s-start+4] = 0; /* null terminate it */
+ strlcpy((*url)+4, start, s-start+1);
+ (*url)[s-start+4] = 0; /* null terminate it */
} else {
*url = tor_strndup(start, s-start);
}