diff options
author | Tor Andersson <tor@ghostscript.com> | 2008-09-29 00:41:56 +0200 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2008-09-29 00:41:56 +0200 |
commit | 32ddf382a3091f976aa94c4a9052fab690f2f3c5 (patch) | |
tree | e4944fd0b4a1a0a467a5dd629d97fb46268875d6 /apps | |
parent | 809e2b93d156f4c92ee0dc44050823f698b0b54d (diff) | |
download | mupdf-32ddf382a3091f976aa94c4a9052fab690f2f3c5.tar.xz |
Fixed uninitialized compiler warnings.
Diffstat (limited to 'apps')
-rw-r--r-- | apps/common/pdfapp.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/apps/common/pdfapp.c b/apps/common/pdfapp.c index 02ae18d9..6d82ef39 100644 --- a/apps/common/pdfapp.c +++ b/apps/common/pdfapp.c @@ -654,29 +654,33 @@ void pdfapp_oncopy(pdfapp_t *app, unsigned short *ucsbuf, int ucslen) p = 0; for (ln = line; ln; ln = ln->next) { - y = y0 - 1; - for (i = 0; i < ln->len; i++) + if (ln->len > 0) { - bx0 = ln->text[i].bbox.x0; - bx1 = ln->text[i].bbox.x1; - by0 = ln->text[i].bbox.y0; - by1 = ln->text[i].bbox.y1; - c = ln->text[i].c; - if (c < 32) - c = '?'; - if (bx1 >= x0 && bx0 <= x1 && by1 >= y0 && by0 <= y1) - if (p < ucslen - 1) - ucsbuf[p++] = c; - } + y = y0 - 1; - if (by1 >= y0 && by0 <= y1) - { + for (i = 0; i < ln->len; i++) + { + bx0 = ln->text[i].bbox.x0; + bx1 = ln->text[i].bbox.x1; + by0 = ln->text[i].bbox.y0; + by1 = ln->text[i].bbox.y1; + c = ln->text[i].c; + if (c < 32) + c = '?'; + if (bx1 >= x0 && bx0 <= x1 && by1 >= y0 && by0 <= y1) + if (p < ucslen - 1) + ucsbuf[p++] = c; + } + + if (by1 >= y0 && by0 <= y1) + { #ifdef WIN32 - if (p < ucslen - 1) - ucsbuf[p++] = '\r'; + if (p < ucslen - 1) + ucsbuf[p++] = '\r'; #endif - if (p < ucslen - 1) - ucsbuf[p++] = '\n'; + if (p < ucslen - 1) + ucsbuf[p++] = '\n'; + } } } |