Bläddra i källkod

Fixed hl_sys_read_dir (#75)

Pascal Peridont 8 år sedan
förälder
incheckning
2e42717f43
1 ändrade filer med 1 tillägg och 1 borttagningar
  1. 1 1
      src/std/sys.c

+ 1 - 1
src/std/sys.c

@@ -466,7 +466,7 @@ HL_PRIM varray *hl_sys_read_dir( vbyte *_path ) {
 			continue;
 			continue;
 		if( pos == count ) {
 		if( pos == count ) {
 			int ncount = count == 0 ? 16 : count * 2;
 			int ncount = count == 0 ? 16 : count * 2;
-			varray *narr = hl_alloc_array(&hlt_bytes,count);
+			varray *narr = hl_alloc_array(&hlt_bytes,ncount);
 			pchar **ncur = hl_aptr(narr,pchar*);
 			pchar **ncur = hl_aptr(narr,pchar*);
 			memcpy(ncur,current,count*sizeof(void*));
 			memcpy(ncur,current,count*sizeof(void*));
 			current = ncur;
 			current = ncur;