The new base 64 encoder adds linebreaks, we need to remove them again for the list...
[citadel.git] / citadel / modules / listsub / serv_listsub.c
index a9fd95bfb8761a8706c2fc1af3f644fa55e5f761..ada4bbadd64e2323be4d29a903020104f4d87cbe 100644 (file)
@@ -48,7 +48,6 @@
 #include "msgbase.h"
 #include "internet_addressing.h"
 #include "clientsocket.h"
-#include "file_ops.h"
 #include "ctdl_module.h"
 
 /*
 void listsub_generate_token(char *buf) {
        char sourcebuf[SIZ];
        static int seq = 0;
+       size_t len;
 
        /* Theo, please sit down and shut up.  This key doesn't have to be
         * tinfoil-hat secure, it just needs to be reasonably unguessable
         * and unique.
         */
-       sprintf(sourcebuf, "%lx",
+       len = sprintf(sourcebuf, "%lx",
                (long) (++seq + getpid() + time(NULL))
        );
 
        /* Convert it to base64 so it looks cool */     
-       CtdlEncodeBase64(buf, sourcebuf, strlen(sourcebuf), 0);
+       len = CtdlEncodeBase64(buf, sourcebuf, len, 0);
+       if (buf[len - 1] == '\n') {
+               buf[len - 1] = '\0';
+       }
 }
 
 const RoomNetCfg ActiveSubscribers[] = {listrecp, digestrecp};