summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cqrlogo.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/cqrlogo.c b/cqrlogo.c
index 4f4692e..3c0e579 100644
--- a/cqrlogo.c
+++ b/cqrlogo.c
@@ -247,18 +247,6 @@ int main(int argc, char **argv) {
uri_server_name = malloc(10 + strlen(server_name));
sprintf(uri_server_name, "http%s://%s/", https ? "s" : "", server_name);
- /* get query string and read settings */
- if ((query_string = getenv("QUERY_STRING")) != NULL) {
- /* do we have a special scale? */
- get_value(query_string, "scale", &scale, QRCODE_SCALE, 1, QRCODE_MAX_SCALE);
-
- /* width of the border? */
- get_value(query_string, "border", &border, QRCODE_BORDER, 0, QRCODE_MAX_BORDER);
-
- /* error correction level? */
- get_value(query_string, "level", &level, QRCODE_LEVEL, 0, QR_ECLEVEL_H);
- }
-
/* get http referer */
if ((http_referer = getenv("HTTP_REFERER")) != NULL) {
uri = http_referer;
@@ -285,6 +273,18 @@ int main(int argc, char **argv) {
uri = uri_server_name;
}
+ /* get query string and read settings */
+ if ((query_string = getenv("QUERY_STRING")) != NULL) {
+ /* do we have a special scale? */
+ get_value(query_string, "scale", &scale, QRCODE_SCALE, 1, QRCODE_MAX_SCALE);
+
+ /* width of the border? */
+ get_value(query_string, "border", &border, QRCODE_BORDER, 0, QRCODE_MAX_BORDER);
+
+ /* error correction level? */
+ get_value(query_string, "level", &level, QRCODE_LEVEL, 0, QR_ECLEVEL_H);
+ }
+
/* encode the QR-Code */
if ((bitmap = encode_qrcode(uri, scale, border, level)) == NULL) {
/* uri too long? retry with uri from server name */