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

Loading…
Cancel
Save