You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
cups/SOURCES/cups-fix-device-uri-in-webu...

45 lines
1.3 KiB

diff --git a/cgi-bin/admin.c b/cgi-bin/admin.c
index e0f1136..02ff51d 100644
--- a/cgi-bin/admin.c
+++ b/cgi-bin/admin.c
@@ -636,7 +636,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
};
- ptr = cgiGetTextfield("DEVICE_URI");
+ ptr = cgiGetVariable("DEVICE_URI");
fprintf(stderr, "DEBUG: do_am_printer: DEVICE_URI=\"%s\"\n",
ptr ? ptr : "(null)");
@@ -697,7 +697,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
}
}
- if ((var = cgiGetTextfield("DEVICE_URI")) != NULL)
+ if ((var = cgiGetVariable("DEVICE_URI")) != NULL)
{
if ((uriptr = strrchr(var, '|')) != NULL)
{
@@ -1130,7 +1130,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */
ippAddString(request, IPP_TAG_PRINTER, IPP_TAG_TEXT, "printer-info",
NULL, cgiGetTextfield("PRINTER_INFO"));
- strlcpy(uri, cgiGetTextfield("DEVICE_URI"), sizeof(uri));
+ strlcpy(uri, cgiGetVariable("DEVICE_URI"), sizeof(uri));
/*
* Strip make and model from URI...
diff --git a/cgi-bin/var.c b/cgi-bin/var.c
index 6ad945d..a4993ff 100644
--- a/cgi-bin/var.c
+++ b/cgi-bin/var.c
@@ -288,7 +288,7 @@ cgiGetTextfield(const char *name) /* I - Name of form field */
value = NULL;
}
- return (value);
+ return (value ? strdup(value) : NULL);
}