Pārlūkot izejas kodu

Bugfixing wrong errno on constant parsing

Yann Weber 6 gadus atpakaļ
vecāks
revīzija
fff97816aa
1 mainītis faili ar 2 papildinājumiem un 1 dzēšanām
  1. 2
    1
      libs/turmit.c

+ 2
- 1
libs/turmit.c Parādīt failu

@@ -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)

Notiek ielāde…
Atcelt
Saglabāt