Poking around in the text client to determine whether we can remove dependency on...
authorArt Cancro <ajc@citadel.org>
Thu, 21 Oct 2021 20:06:13 +0000 (16:06 -0400)
committerArt Cancro <ajc@citadel.org>
Thu, 21 Oct 2021 20:06:13 +0000 (16:06 -0400)
textclient/citadel.c
textclient/citadel_ipc.c
textclient/client_chat.c
textclient/messages.c
textclient/rooms.c
textclient/routines2.c

index bb165dd8eb251667f7eb08af0581701c95f87399..d60dfc1e7a1780496745908c5584707621ed83e0 100644 (file)
@@ -374,7 +374,7 @@ void dotgoto(CtdlIPC * ipc, char *towhere, int display_name, int fromungoto)
                scr_printf("%s\n", aaa);
                return;
        }
-       safestrncpy(room_name, room->RRname, ROOMNAMELEN);
+       strncpy(room_name, room->RRname, ROOMNAMELEN);
        room_flags = room->RRflags;
        room_flags2 = room->RRflags2;
        from_floor = curr_floor;
index dc8976444a71ff5f27b3ac62081aafac94cbb5a8..ac8c593c49bb8f3c3df4578e0163a073a7d73b1e 100644 (file)
@@ -633,21 +633,21 @@ int CtdlIPCGetSingleMessage(CtdlIPC * ipc, long msgnum, int headers, int as_mime
                                if (!strncasecmp(aaa, "nhdr=yes", 8))
                                        mret[0]->nhdr = 1;
                                else if (!strncasecmp(aaa, "from=", 5))
-                                       safestrncpy(mret[0]->author, &aaa[5], SIZ);
+                                       strncpy(mret[0]->author, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "type=", 5))
                                        mret[0]->type = atoi(&aaa[5]);
                                else if (!strncasecmp(aaa, "msgn=", 5))
-                                       safestrncpy(mret[0]->msgid, &aaa[5], SIZ);
+                                       strncpy(mret[0]->msgid, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "subj=", 5))
-                                       safestrncpy(mret[0]->subject, &aaa[5], SIZ);
+                                       strncpy(mret[0]->subject, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "rfca=", 5))
-                                       safestrncpy(mret[0]->email, &aaa[5], SIZ);
+                                       strncpy(mret[0]->email, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "room=", 5))
-                                       safestrncpy(mret[0]->room, &aaa[5], SIZ);
+                                       strncpy(mret[0]->room, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "rcpt=", 5))
-                                       safestrncpy(mret[0]->recipient, &aaa[5], SIZ);
+                                       strncpy(mret[0]->recipient, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "wefw=", 5))
-                                       safestrncpy(mret[0]->references, &aaa[5], SIZ);
+                                       strncpy(mret[0]->references, &aaa[5], SIZ);
                                else if (!strncasecmp(aaa, "time=", 5))
                                        mret[0]->time = atol(&aaa[5]);
                                else if (!strncasecmp(aaa, "locl", 4))
@@ -2880,7 +2880,7 @@ static int uds_connectsock(int *isLocal, char *sockpath)
 
        memset(&addr, 0, sizeof(addr));
        addr.sun_family = AF_UNIX;
-       safestrncpy(addr.sun_path, sockpath, sizeof addr.sun_path);
+       strncpy(addr.sun_path, sockpath, sizeof addr.sun_path);
 
        s = socket(AF_UNIX, SOCK_STREAM, 0);
        if (s < 0) {
index 1339d0e61b703eab311ebfb1c7ffcdce51d701a6..55ccb9b4da98932fe44c924178f303695bdc6b00 100644 (file)
@@ -153,7 +153,7 @@ void chatmode(CtdlIPC *ipc) {
                                } else {
                                        size_t i = MIN(sizeof buf - 1, strlen(c_user) + 2);
                                        memset(buf, ' ', i);
-                                       safestrncpy(&buf[i], c_text, sizeof buf - i);
+                                       strncpy(&buf[i], c_text, sizeof buf - i);
                                }
                                while (strlen(buf) < 79) {
                                        strcat(buf, " ");
index 3fc71730040495f947ffa3acc3c0a29dcf1f71c2..22a178e8a73eb4076cf295af5a86bfb519e88848 100644 (file)
@@ -562,28 +562,28 @@ int read_message(CtdlIPC *ipc,
                        snprintf(reply_to, sizeof reply_to, "%s <%s>", message->author, message->email);
                }
                else {
-                       safestrncpy(reply_to, message->email, sizeof reply_to);
+                       strncpy(reply_to, message->email, sizeof reply_to);
                }
        }
 
        /* But if we can't do that, set it to a Citadel address.
         */
        if (!strcmp(reply_to, NO_REPLY_TO)) {
-               safestrncpy(reply_to, message->author, sizeof(reply_to));
+               strncpy(reply_to, message->author, sizeof(reply_to));
        }
 
        if (message->msgid != NULL) {
-               safestrncpy(reply_inreplyto, message->msgid, sizeof reply_inreplyto);
+               strncpy(reply_inreplyto, message->msgid, sizeof reply_inreplyto);
        }
 
        if (message->references != NULL) {
                if (!IsEmptyStr(message->references)) {
-                       safestrncpy(reply_references, message->references, sizeof reply_references);
+                       strncpy(reply_references, message->references, sizeof reply_references);
                }
        }
 
        if (message->subject != NULL) {
-               safestrncpy(reply_subject, message->subject, sizeof reply_subject);
+               strncpy(reply_subject, message->subject, sizeof reply_subject);
                if (!IsEmptyStr(message->subject)) {
                        if (dest) {
                                fprintf(dest, "Subject: %s\n", message->subject);
@@ -640,7 +640,7 @@ int read_message(CtdlIPC *ipc,
                while ((searchptr != NULL) && (num_urls < MAXURLS)) {
                        searchptr = strstr(searchptr, urlprefixes[p]);
                        if (searchptr != NULL) {
-                               safestrncpy(urls[num_urls], searchptr, sizeof(urls[num_urls]));
+                               strncpy(urls[num_urls], searchptr, sizeof(urls[num_urls]));
                                for (i = 0; i < strlen(urls[num_urls]); i++) {
                                        ch = urls[num_urls][i];
                                        if (ch == '>' || ch == '\"' || ch == ')' || ch == ' ' || ch == '\n') {
index 5c65cea82f83405c33ecf07b76e4c1d9f2ff184c..8bef2ddfa364d872fc2125bed09a02a8d3d557cb 100644 (file)
@@ -415,7 +415,7 @@ int select_floor(CtdlIPC * ipc, int rfloor)
 
                do {
                        newfloor = (-1);
-                       safestrncpy(floorstr, floorlist[rfloor], sizeof floorstr);
+                       strncpy(floorstr, floorlist[rfloor], sizeof floorstr);
                        strprompt("Which floor", floorstr, 255);
                        for (a = 0; a < 128; ++a) {
                                if (!strcasecmp(floorstr, &floorlist[a][0]))
@@ -473,7 +473,7 @@ void editthisroom(CtdlIPC * ipc)
        /* Fetch the name of the current room admin */
        r = CtdlIPCGetRoomAide(ipc, buf);
        if (r / 100 == 2) {
-               safestrncpy(room_admin_name, buf, sizeof room_admin_name);
+               strncpy(room_admin_name, buf, sizeof room_admin_name);
        } else {
                strcpy(room_admin_name, "");
        }
@@ -656,7 +656,7 @@ void dotungoto(CtdlIPC * ipc, char *towhere)
        if (r / 100 != 2) {
                scr_printf("%s\n", buf);
        }
-       safestrncpy(buf, uglist[found], sizeof(buf));
+       strncpy(buf, uglist[found], sizeof(buf));
        /* we queue ungoto information here, because we're not really
           ungotoing, we're really going to a random spot in some arbitrary
           room list. */
@@ -683,7 +683,7 @@ void ungoto(CtdlIPC * ipc)
        if (r / 100 != 2) {
                scr_printf("%s\n", buf);
        }
-       safestrncpy(buf, uglist[uglistsize - 1], sizeof(buf));
+       strncpy(buf, uglist[uglistsize - 1], sizeof(buf));
        uglistsize--;
        free(uglist[uglistsize]);
        /* Don't queue ungoto info or we end up in a loop */
@@ -1054,7 +1054,7 @@ void readinfo(CtdlIPC * ipc)
        /* Name of currernt room admin */
        r = CtdlIPCGetRoomAide(ipc, buf);
        if (r / 100 == 2)
-               safestrncpy(room_admin_name, buf, sizeof room_admin_name);
+               strncpy(room_admin_name, buf, sizeof room_admin_name);
        else
                strcpy(room_admin_name, "");
 
index bca697cd260b0a45a50d7f6483afa37dae82656e..77fbe133c009ba2bda7d1c948dc5a4b9287b04f9 100644 (file)
@@ -75,21 +75,21 @@ void entregis(CtdlIPC * ipc) {
                        remove_token(reg, 0, '\n');
 
                        if (a == 2)
-                               safestrncpy(tmpname, buf, sizeof tmpname);
+                               strncpy(tmpname, buf, sizeof tmpname);
                        else if (a == 3)
-                               safestrncpy(tmpaddr, buf, sizeof tmpaddr);
+                               strncpy(tmpaddr, buf, sizeof tmpaddr);
                        else if (a == 4)
-                               safestrncpy(tmpcity, buf, sizeof tmpcity);
+                               strncpy(tmpcity, buf, sizeof tmpcity);
                        else if (a == 5)
-                               safestrncpy(tmpstate, buf, sizeof tmpstate);
+                               strncpy(tmpstate, buf, sizeof tmpstate);
                        else if (a == 6)
-                               safestrncpy(tmpzip, buf, sizeof tmpzip);
+                               strncpy(tmpzip, buf, sizeof tmpzip);
                        else if (a == 7)
-                               safestrncpy(tmpphone, buf, sizeof tmpphone);
+                               strncpy(tmpphone, buf, sizeof tmpphone);
                        else if (a == 9)
-                               safestrncpy(tmpemail, buf, sizeof tmpemail);
+                               strncpy(tmpemail, buf, sizeof tmpemail);
                        else if (a == 10)
-                               safestrncpy(tmpcountry, buf, sizeof tmpcountry);
+                               strncpy(tmpcountry, buf, sizeof tmpcountry);
                        ++a;
                }
        }
@@ -103,7 +103,7 @@ void entregis(CtdlIPC * ipc) {
 
        do {
                ok = 1;
-               safestrncpy(holdemail, tmpemail, sizeof holdemail);
+               strncpy(holdemail, tmpemail, sizeof holdemail);
                strprompt("Email address", tmpemail, 31);
                r = CtdlIPCDirectoryLookup(ipc, tmpemail, buf);
                if (r / 100 == 2) {
@@ -116,7 +116,7 @@ void entregis(CtdlIPC * ipc) {
                                scr_printf("\nYou can't use %s as your address.\n", tmpemail);
                                scr_printf("It is already in use by %s @ %s.\n", diruser, dirnode);
                                ok = 0;
-                               safestrncpy(tmpemail, holdemail, sizeof tmpemail);
+                               strncpy(tmpemail, holdemail, sizeof tmpemail);
                        }
                }
        } while (ok == 0);