]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/wx-console/console_conf.c
Correct compile error
[bacula/bacula] / bacula / src / wx-console / console_conf.c
index 82bb8842d8cd90a9da8c30b2c278de44e320212c..a452df449576dd7b21537539aa626915c7384aaf 100644 (file)
@@ -28,8 +28,8 @@
    many others, a complete list can be found in the file AUTHORS.
    This program is Free Software; you can redistribute it and/or
    modify it under the terms of version two of the GNU General Public
-   License as published by the Free Software Foundation plus additions
-   that are listed in the file LICENSE.
+   License as published by the Free Software Foundation and included
+   in the file LICENSE.
 
    This program is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -320,15 +320,16 @@ void save_resource(int type, RES_ITEM *items, int pass)
       if (!res_head[rindex]) {
          res_head[rindex] = (RES *)res; /* store first entry */
       } else {
-         RES *next;
-         for (next=res_head[rindex]; next->next; next=next->next) {
+         RES *next, *last;
+         for (last=next=res_head[rindex]; next; next=next->next) {
+            last = next;
             if (strcmp(next->name, res->res_dir.hdr.name) == 0) {
                Emsg2(M_ERROR_TERM, 0,
                    wxString(_("Attempt to define second %s resource named \"%s\" is not permitted.\n")).mb_str(*wxConvCurrent),
                    resources[rindex].name, res->res_dir.hdr.name);
             }
          }
-         next->next = (RES *)res;
+         last->next = (RES *)res;
             Dmsg2(90, "Inserting %s res: %s\n", res_to_str(type),
                   res->res_dir.hdr.name);
       }