Browse Source

Bugfixing wrong errno on constant parsing

Yann Weber 6 years ago
parent
commit
fff97816aa
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      libs/turmit.c

+ 2
- 1
libs/turmit.c View File

@@ -9,8 +9,8 @@ TURMIT_OP(mem_sz)
9 9
 	old_blc = (old_sz / TURMIT_STACK_GROW) + 1;
10 10
 
11 11
 	new_sz = SPOP(turmit);
12
-	new_sz = new_sz<2?2:new_sz;
13 12
 	new_sz %= TURMIT_STACK_MAX;
13
+	new_sz = new_sz<2?2:new_sz;
14 14
 	new_blc = (new_sz / TURMIT_STACK_GROW) + 1;
15 15
 
16 16
 	if(new_blc != old_blc)
@@ -342,6 +342,7 @@ int turmit_compile(turmit_t *turmit)
342 342
 		if(strncasecmp("0x", cur, 2) == 0)
343 343
 		{
344 344
 			cur+= 2;
345
+			errno = 0;
345 346
 			iret = strtol(cur, &endptr, 16);
346 347
 			err = errno;
347 348
 			if(err || endptr == cur)

Loading…
Cancel
Save