summaryrefslogtreecommitdiff
path: root/utils/themeeditor/skin_scan.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/themeeditor/skin_scan.c')
-rw-r--r--utils/themeeditor/skin_scan.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/utils/themeeditor/skin_scan.c b/utils/themeeditor/skin_scan.c
index 599683db54..19e959b5b8 100644
--- a/utils/themeeditor/skin_scan.c
+++ b/utils/themeeditor/skin_scan.c
@@ -101,9 +101,9 @@ char* scan_string(char** document)
101int scan_int(char** document) 101int scan_int(char** document)
102{ 102{
103 103
104 char* cursor = *document; 104 char* cursor = *document, *end;
105 int length = 0; 105 int length = 0;
106 char* buffer = NULL; 106 char buffer[16];
107 int retval; 107 int retval;
108 int i; 108 int i;
109 109
@@ -118,9 +118,9 @@ int scan_int(char** document)
118 length++; 118 length++;
119 cursor++; 119 cursor++;
120 } 120 }
121 121 if (length > 15)
122 buffer = skin_alloc_string(length); 122 length = 15;
123 123 end = cursor;
124 /* Copying to the buffer while avoiding comments */ 124 /* Copying to the buffer while avoiding comments */
125 cursor = *document; 125 cursor = *document;
126 buffer[length] = '\0'; 126 buffer[length] = '\0';
@@ -138,9 +138,8 @@ int scan_int(char** document)
138 138
139 } 139 }
140 retval = atoi(buffer); 140 retval = atoi(buffer);
141 free(buffer);
142 141
143 *document = cursor; 142 *document = end;
144 return retval; 143 return retval;
145} 144}
146 145