romanbsd-jsmin-ffi 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/ext/jsmin.cpp +5 -2
- data/ext/jsmin.h +1 -0
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.2
|
data/ext/jsmin.cpp
CHANGED
@@ -60,6 +60,9 @@ int Jsmin::get()
|
|
60
60
|
{
|
61
61
|
int c = theLookahead;
|
62
62
|
theLookahead = 0;
|
63
|
+
if ( index_in >= m_size ) {
|
64
|
+
return 0;
|
65
|
+
}
|
63
66
|
if (c == 0) {
|
64
67
|
c = input_buf[index_in++];
|
65
68
|
}
|
@@ -200,8 +203,8 @@ char* Jsmin::minify(char *original)
|
|
200
203
|
free(output_buf);
|
201
204
|
output_buf = NULL;
|
202
205
|
}
|
203
|
-
|
204
|
-
output_buf = (char *)malloc(sizeof(char) *
|
206
|
+
m_size = strlen(original);
|
207
|
+
output_buf = (char *)malloc(sizeof(char) * (m_size+1));
|
205
208
|
|
206
209
|
theA = '\n';
|
207
210
|
action(3);
|
data/ext/jsmin.h
CHANGED