Browse Source

evx: fix bugs that found by writing an article, nice

rain 4 năm trước cách đây
mục cha
commit
dd5e5d8722
2 tập tin đã thay đổi với 2 bổ sung và 2 xóa
  1. 1 1
      kernel/mempool.c
  2. 1 1
      kernel/vsprintf.c

+ 1 - 1
kernel/mempool.c

@@ -173,7 +173,7 @@ int free_s(void *p, int size) {
 		while (pool && pool->cache != cache) 
 			pool = pool->next_pool;
 
-		if (!pool) 
+		if (!pool && size) 
 			panic("WARNING: free_s: object is not in any mempool\n");
 	}
 

+ 1 - 1
kernel/vsprintf.c

@@ -53,7 +53,7 @@ static int number(char *buf, long x, int base, int flags, int width) {
 
 	memset(t, 0, PTRSIZE * 2);
 
-	if (!(flags & UNSIGNED) && nr < 0) {
+	if (!(flags & UNSIGNED) && x < 0) {
 		nr = -x;
 		neg = 1;
 	}