diff options
author | Christian Hesse <mail@eworm.de> | 2013-05-30 23:18:34 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2013-05-30 23:18:34 +0200 |
commit | 7f84fb9489f55b373db819b5117e706c75578300 (patch) | |
tree | 42291e4eeb9847300b6b6f01671929a20eec43a7 /cqrlogo.c | |
parent | ac49c6c586b6c232741da6c39dcee684eeb94119 (diff) | |
download | cqrlogo-7f84fb9489f55b373db819b5117e706c75578300.tar.gz cqrlogo-7f84fb9489f55b373db819b5117e706c75578300.tar.zst |
cut http_referer for meta data if longer than 79 chars
Diffstat (limited to 'cqrlogo.c')
-rw-r--r-- | cqrlogo.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -107,6 +107,15 @@ int main(int argc, char **argv) { /* print HTTP header */ printf("Content-Type: image/png\n\n"); + /* cut http_referer, text in png file may have a max length of 79 chars */ + if (strlen(http_referer) > 79) { + if (!rc) { + http_referer = strdup(http_referer); + rc = 1; + } + sprintf(http_referer + 76, "..."); + } + /* print PNG data */ gdk_pixbuf_save_to_buffer (pixbuf, &buffer, &size, "png", NULL, "compression", "9", |