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

[or-cvs] Always include newline with port section of exit policy



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

Modified Files:
	routers.c 
Log Message:
Always include newline with port section of exit policy

Index: routers.c
===================================================================
RCS file: /home/or/cvsroot/src/or/routers.c,v
retrieving revision 1.93
retrieving revision 1.94
diff -u -d -r1.93 -r1.94
--- routers.c	17 Nov 2003 07:37:45 -0000	1.93
+++ routers.c	18 Nov 2003 06:51:29 -0000	1.94
@@ -1285,7 +1285,7 @@
       return -1;
     }
     written += result;
-    if (tmpe->msk != 0xFFFFFFFFu) {
+    if (tmpe->msk != 0xFFFFFFFFu && tmpe->msk != 0) {
       in.s_addr = htonl(tmpe->msk);
       result = snprintf(s+written, maxlen-written, "/%s", inet_ntoa(in));
       if (result<0 || result+written > maxlen)
@@ -1293,19 +1293,16 @@
       written += result;
     }
     if (tmpe->prt) {
-      result = snprintf(s+written, maxlen-written, ":%d", tmpe->prt);
+      result = snprintf(s+written, maxlen-written, ":%d\n", tmpe->prt);
       if (result<0 || result+written > maxlen)
         return -1;
       written += result;
     } else {
       if (written > maxlen-4)
         return -1;
-      strcat(s+written, ":*");
+      strcat(s+written, ":*\n");
+      written += 3;
     }
-    if(written > maxlen-1)
-      return -1;
-    strcat(s+written, "\n");
-    written++;
   } /* end for */
   if (written > maxlen-256) /* Not enough room for signature. */
     return -1;