]> code.citadel.org Git - citadel.git/blobdiff - citadel/messages.c
* extract_token() now expects to be supplied with the size of the
[citadel.git] / citadel / messages.c
index 160be8632ff950a771e251f2578ea5584b90bbcc..53949a7ad5ee8d7d2fb8e2bd5bbf8f0d7341efa1 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * $Id$
  *
- * Citadel/UX message support routines
+ * Citadel message support routines
  * see copyright.txt for copyright information
  */
 
@@ -818,8 +818,8 @@ int client_make_message(CtdlIPC *ipc,
                } else if (strlen(editor_paths[0]) > 0) {
                        editor_path = editor_paths[0];
                } else {
-                       err_printf
-                           ("*** No editor available, using built-in editor\n");
+                       err_printf("*** No editor available, "
+                               "using built-in editor\n");
                        mode = 0;
                }
        }
@@ -856,7 +856,8 @@ int client_make_message(CtdlIPC *ipc,
        if (mode == 0) {
                fp = fopen(filename, "r");
                if (fp != NULL) {
-                       fmout(screenwidth, fp, NULL, NULL, 0, screenheight, 0, 0);
+                       fmout(screenwidth, fp, NULL, NULL, 0,
+                               screenheight, 0, 0);
                        beg = ftell(fp);
                        fclose(fp);
                } else {
@@ -1187,7 +1188,8 @@ int entmsg(CtdlIPC *ipc,
        }
 
        /* Now compose the message... */
-       if (client_make_message(ipc, temp, message.recipient, message.anonymous, 0, c, message.subject) != 0) {
+       if (client_make_message(ipc, temp, message.recipient,
+          message.anonymous, 0, c, message.subject) != 0) {
                return (2);
        }
 
@@ -1424,7 +1426,7 @@ void image_view(CtdlIPC *ipc, unsigned long msg)
                                void *file = NULL; /* The downloaded file */
                                int r;
        
-                               // view image
+                               /* view image */
                                found = -found;
                                r = CtdlIPCAttachmentDownload(ipc, msg, ptr->number, &file, progress, buf);
                                if (r / 100 != 2) {
@@ -1764,7 +1766,7 @@ RMSGREAD: scr_flush();
                        if (r / 100 != 2) {
                                scr_printf("%s\n", cmd);
                        } else {
-                               extract(filename, cmd, 2);
+                               extract_token(filename, cmd, 2, '|', sizeof filename);
                                /*
                                 * Part 1 won't have a filename; use the
                                 * subject of the message instead. IO
@@ -1817,11 +1819,11 @@ RMSGREAD:       scr_flush();
                   We have to load up messages until we find one by us */
                char buf[SIZ];
                int founda = 0;
-               struct ctdlipcmessage *msg;
+               struct ctdlipcmessage *msg = NULL;
                 
                /* read the header so we can get 'from=' */
                r = CtdlIPCGetSingleMessage(ipc, msg_arr[finda], 1, 0, &msg, buf);
-               if (!strncasecmp(msg->author, fullname)) {
+               if (!strncasecmp(msg->author, fullname, sizeof(fullname))) {
                        a = lasta; /* meesa current */
                        founda = 1;
                }
@@ -1881,7 +1883,7 @@ void check_message_base(CtdlIPC *ipc)
 
        while (transcript && strlen(transcript)) {
                lines_printed = 1;
-               extract_token(buf, transcript, 0, '\n');
+               extract_token(buf, transcript, 0, '\n', sizeof buf);
                remove_token(transcript, 0, '\n');
                pprintf("%s\n", buf);
        }