From b22114a2d8b3975aef66b58f6bff3ac2a315034d Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Fri, 21 Sep 2012 18:20:06 +0200 Subject: [PATCH 1/3] Make sure array index is >= 0 Fixes this warning on array subscript type: UTF.cc: In function 'int TextStringToUCS4(GooString*, Unicode**)': UTF.cc:99:33: warning: array subscript has type 'char' [-Wchar-subscripts] --- poppler/UTF.cc | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/poppler/UTF.cc b/poppler/UTF.cc index 8e9cb9d..990884f 100644 --- a/poppler/UTF.cc +++ b/poppler/UTF.cc @@ -15,6 +15,7 @@ // // Copyright (C) 2008 Koji Otani // Copyright (C) 2012 Adrian Johnson +// Copyright (C) 2012 Hib Eris // // To see a description of the changes please see the Changelog file that // came with your tarball or type make ChangeLog if you are building from git @@ -96,7 +97,7 @@ int TextStringToUCS4(GooString *textStr, Unicode **ucs4) } else { u = (Unicode*)gmallocn(len, sizeof(Unicode)); for (i = 0 ; i < len; i++) { - u[i] = pdfDocEncoding[s[i]]; + u[i] = pdfDocEncoding[(unsigned char)s[i]]; } } *ucs4 = u; -- 1.7.5.4