소스 검색

core: sint2str check for space before adding the sign

Andrei Pelinescu-Onciul 16 년 전
부모
커밋
b660455a30
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ut.h

+ 1 - 1
ut.h

@@ -312,7 +312,7 @@ static inline char* sint2str(long l, int* len)
 		l = -l;
 	}
 	p = int2str((unsigned long)l, len);
-	if(sign) {
+	if(sign && *len<(INT2STR_MAX_LEN-1)) {
 		*(--p) = '-';
 		if (len) (*len)++;
 	}