summaryrefslogtreecommitdiffstats
path: root/cqrlogo.c
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-02-25 13:19:14 +0100
committerGravatar Christian Hesse <mail@eworm.de>2014-02-25 13:19:14 +0100
commit94405f6b6011aaee0c5258425092720b46a79308 (patch)
treebc212a7790889c3e2b9cc5abe1d0ad88ecba44ea /cqrlogo.c
parent87ffef6e32856495b8175553dcfbeb288c30e56a (diff)
downloadcqrlogo-94405f6b6011aaee0c5258425092720b46a79308.tar.gz
cqrlogo-94405f6b6011aaee0c5258425092720b46a79308.tar.zst
make the lib handle max png comment size
Diffstat (limited to 'cqrlogo.c')
-rw-r--r--cqrlogo.c12
1 files changed, 1 insertions, 11 deletions
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);