From 94405f6b6011aaee0c5258425092720b46a79308 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 25 Feb 2014 13:19:14 +0100 Subject: make the lib handle max png comment size --- cqrlogo.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'cqrlogo.c') diff --git a/cqrlogo.c b/cqrlogo.c index 4b87371..bfdd3d2 100644 --- a/cqrlogo.c +++ b/cqrlogo.c @@ -13,7 +13,7 @@ /*** main ***/ int main(int argc, char **argv) { const char * http_referer, * server_name, * query_string, * uri; - char * uri_server_name, * uri_png, * pattern, * stolen; + char * uri_server_name, * pattern, * stolen; regex_t preg; regmatch_t pmatch[1]; uint8_t https; @@ -28,7 +28,6 @@ int main(int argc, char **argv) { #endif /* do the variable initialization within the loop! */ uri_server_name = NULL; - uri_png = NULL; pattern = NULL; stolen = NULL; @@ -98,13 +97,6 @@ int main(int argc, char **argv) { /* print HTTP header */ printf("Content-Type: image/png\n\n"); - /* cut uri, text in png file may have a max length of 79 chars */ - if (strlen(uri) > 79) { - uri_png = strdup(uri); - sprintf(uri_png + 76, "..."); - uri = uri_png; - } - /* generate PNG data */ if ((png = generate_png(bitmap, CQR_COMMENT|CQR_REFERER|CQR_VERSION|CQR_LIBVERSION, uri)) == NULL) { fprintf(stderr, "Failed to generate PNG.\n"); @@ -119,8 +111,6 @@ int main(int argc, char **argv) { free(uri_server_name); if (stolen) free(stolen); - if (uri_png) - free(uri_png); bitmap_free(bitmap); if (png->size > 0) free(png->buffer); -- cgit v1.2.3-54-g00ecf