Skip to content

Commit bee6a87

Browse files
committed
Cast unsigned int to int as int is less than 3641144. Minor fixes.
1 parent e90208c commit bee6a87

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

c/iscpython.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ int StreamInit(int length)
174174
free(inStream);
175175
inStream = NULL;
176176
}
177-
inStream = malloc(1 + sizeof(char) * length);
177+
inStream = calloc(length + 1, sizeof(char));
178178
curpos = 0;
179179
maxpos = length;
180180

@@ -188,7 +188,7 @@ int StreamInit(int length)
188188
// Write piece of inStream
189189
int StreamWrite(CACHE_EXSTRP command)
190190
{
191-
if ((!inStream) || (command->len + curpos > maxpos)) {
191+
if ((!inStream) || ((int)command->len + curpos > maxpos)) {
192192
return ZF_FAILURE;
193193
}
194194

isc/py/Main.cls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ ClassMethod SimpleString(code As %String = "", variable As %String = "", seriali
1717
set result = ""
1818
#dim ex As %Exception.General
1919
if (ex.Name = "<FUNCTION>") {
20-
set sc = $$$ERROR($$$GeneralError, "Unable to allocate memory")
20+
set sc = $$$ERROR($$$GeneralError, "Python Error. Probably variable '" _ variable _ "' is longer than current limit: " _ $$$MaxStringLength)
2121
} else {
2222
set sc = ex.AsStatus()
2323
}

isc/py/util/Matcher.cls

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ Class isc.py.util.Matcher
99
ClassMethod MatchOr(input As %String, list As %String) As %Boolean
1010
{
1111
set ok = $$$NO
12-
for pie=1:1:$L(list,",") {
13-
set mask=$P(list,",",pie)
12+
for pie = 1:1:$length(list,",") {
13+
set mask = $piece(list,",",pie)
1414
if mask'="",..Match(input,mask) {
1515
set ok = $$$YES
1616
}
@@ -25,8 +25,8 @@ ClassMethod MatchOr(input As %String, list As %String) As %Boolean
2525
ClassMethod MatchAnd(input As %String, list As %String) As %Boolean
2626
{
2727
set ok = $$$YES
28-
for pie=1:1:$L(list,",") {
29-
set mask=$P(list,",",pie)
28+
for pie = 1:1:$length(list,",") {
29+
set mask = $piece(list,",",pie)
3030
if mask'="",'..Match(input,mask) {
3131
set ok = $$$NO
3232
}

0 commit comments

Comments
 (0)