From 32ddf382a3091f976aa94c4a9052fab690f2f3c5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 29 Sep 2008 00:41:56 +0200 Subject: Fixed uninitialized compiler warnings. --- apps/common/pdfapp.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'apps') 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'; + } } } -- cgit v1.2.3