romanbsd-jsmin-ffi 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- 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