[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Stop requiring newline at end of exit policy.



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/tmp/cvs-serv23738

Modified Files:
	routers.c 
Log Message:
Stop requiring newline at end of exit policy.

Index: routers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routers.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- routers.c	7 Oct 2003 22:09:09 -0000	1.71
+++ routers.c	7 Oct 2003 22:15:47 -0000	1.72
@@ -952,8 +952,13 @@
   directory_token_t tok;
   char *tmp, *cp;
   int r;
+  int len;
 
-  tmp = cp = tor_strdup(s);
+  len = strlen(s);
+  tmp = cp = tor_malloc(len+2);
+  strcpy(tmp, s);
+  tmp[len]='\n';
+  tmp[len+1]='\0';
   if (router_get_next_token(&cp, &tok)) {
     log_fn(LOG_WARNING, "Error reading exit policy: %s", tok.val.error);
     free(tmp);