]> code.citadel.org Git - citadel.git/blobdiff - citadel/serv_inetcfg.c
* extract_token() now expects to be supplied with the size of the
[citadel.git] / citadel / serv_inetcfg.c
index 877b2fb2c6299ed36d8e5a31f194e1f81a0ee240..89b5e5d66bdbd925e9ab0ae56096045f07320520 100644 (file)
@@ -61,7 +61,7 @@ void inetcfg_setTo(struct CtdlMessage *msg) {
 
        if (conf != NULL) {
                do {
-                       extract_token(buf, conf, 0, '\n');
+                       extract_token(buf, conf, 0, '\n', sizeof buf);
                        strcpy(conf, &conf[strlen(buf)+1]);
                } while ( (strlen(conf)>0) && (strlen(buf)>0) );
 
@@ -93,7 +93,7 @@ void spamstrings_setTo(struct CtdlMessage *msg) {
 
        n = num_tokens(conf, '\n');
        for (i=0; i<n; ++i) {
-               extract_token(buf, conf, i, '\n');
+               extract_token(buf, conf, i, '\n', sizeof buf);
                sptr = malloc(sizeof(struct spamstrings_t));
                sptr->string = strdup(buf);
                sptr->next = spamstrings;
@@ -129,12 +129,6 @@ int inetcfg_aftersave(struct CtdlMessage *msg) {
                           strlen(INTERNETCFG))) {
                                inetcfg_setTo(msg);     /* changing configs */
                        }
-#ifdef ___NOT_CURRENTLY_IN_USE___
-                       if (!strncasecmp(&ptr[14], SPAMSTRINGS,
-                          strlen(INTERNETCFG))) {
-                               spamstrings_setTo(msg); /* changing configs */
-                       }
-#endif
                }
 
                ptr = strchr((char *)ptr, '\n');
@@ -148,7 +142,7 @@ int inetcfg_aftersave(struct CtdlMessage *msg) {
 void inetcfg_init_backend(long msgnum, void *userdata) {
        struct CtdlMessage *msg;
 
-               msg = CtdlFetchMessage(msgnum);
+               msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {
                inetcfg_setTo(msg);
                        CtdlFreeMessage(msg);
@@ -160,7 +154,7 @@ void inetcfg_init_backend(long msgnum, void *userdata) {
 void spamstrings_init_backend(long msgnum, void *userdata) {
        struct CtdlMessage *msg;
 
-               msg = CtdlFetchMessage(msgnum);
+               msg = CtdlFetchMessage(msgnum, 1);
                if (msg != NULL) {
                spamstrings_setTo(msg);
                        CtdlFreeMessage(msg);
@@ -173,10 +167,6 @@ void inetcfg_init(void) {
        if (getroom(&CC->room, SYSCONFIGROOM) != 0) return;
        CtdlForEachMessage(MSGS_LAST, 1, INTERNETCFG, NULL,
                inetcfg_init_backend, NULL);
-/*
-       CtdlForEachMessage(MSGS_LAST, 1, SPAMSTRINGS, NULL,
-               spamstrings_init_backend, NULL);
- */
 }