Browse code

pdf: fix for '\r' in obj dictionary debug

Kevin Lin authored on 2016/04/02 04:20:36
Showing 1 changed files
... ...
@@ -1466,7 +1466,9 @@ void pdf_parseobj(struct pdf_struct *pdf, struct pdf_obj *obj)
1466 1466
         char * dictionary = malloc(dict_length + 1);
1467 1467
         if (dictionary) {
1468 1468
             for (i = 0; i < dict_length; i++) {
1469
-                if (isprint(dict[i]) || isspace(dict[i]))
1469
+                if (dict[i] == '\r')
1470
+                    dictionary[i] = '\n';
1471
+                else if (isprint(dict[i]) || isspace(dict[i]))
1470 1472
                     dictionary[i] = dict[i];
1471 1473
                 else
1472 1474
                     dictionary[i] = '*';