]> wimlib.net Git - wimlib/blobdiff - src/xml.c
split WIM apply, doc updates
[wimlib] / src / xml.c
index 943fb8340020c801084ebda14d8b9c7a60838dd6..73ba38e41f14b3f0be756048641d57610936098e 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
  * This file is part of wimlib, a library for working with WIM files.
  *
  * wimlib is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
+ * terms of the GNU General Public License as published by the Free
+ * Software Foundation; either version 3 of the License, or (at your option)
  * any later version.
  *
  * wimlib is distributed in the hope that it will be useful, but WITHOUT ANY
  * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
- * A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * A PARTICULAR PURPOSE. See the GNU General Public License for more
  * details.
  *
- * You should have received a copy of the GNU Lesser General Public License
+ * You should have received a copy of the GNU General Public License
  * along with wimlib; if not, see http://www.gnu.org/licenses/.
  */
 
@@ -819,8 +819,6 @@ static int clone_windows_info(const struct windows_info *old,
 
 static int clone_image_info(const struct image_info *old, struct image_info *new)
 {
-       int ret;
-
        new->dir_count              = old->dir_count;
        new->file_count             = old->file_count;
        new->total_bytes            = old->total_bytes;
@@ -869,8 +867,6 @@ int xml_export_image(const struct wim_info *old_wim_info,
        struct wim_info *new_wim_info;
        struct image_info *image_info;
        int ret;
-       char *name;
-       char *desc;
 
        DEBUG("Copying XML data between WIM files for source image %d.", image);
 
@@ -1360,6 +1356,9 @@ WIMLIBAPI int wimlib_set_image_name(WIMStruct *w, int image, const char *name)
 
        DEBUG("Setting the name of image %d to %s", image, name);
 
+       if (!w)
+               return WIMLIB_ERR_INVALID_PARAM;
+
        if (!name || !*name) {
                ERROR("Must specify a non-empty string for the image name");
                return WIMLIB_ERR_INVALID_PARAM;
@@ -1397,6 +1396,9 @@ WIMLIBAPI int wimlib_set_image_descripton(WIMStruct *w, int image,
 
        DEBUG("Setting the description of image %d to %s", image, description);
 
+       if (!w)
+               return WIMLIB_ERR_INVALID_PARAM;
+
        if (image < 1 || image > w->hdr.image_count) {
                ERROR("%d is not a valid image", image);
                return WIMLIB_ERR_INVALID_IMAGE;