소스 검색

printf: "if a precision is specified, the '0' flag shall be ignored."

Rich Felker 13 년 전
부모
커밋
a9e6d01114
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/stdio/vfprintf.c

+ 1 - 1
src/stdio/vfprintf.c

@@ -570,11 +570,11 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg,
 		case 'u':
 			a = fmt_u(arg.i, z);
 			}
+			if (p>=0) fl &= ~ZERO_PAD;
 			if (!arg.i && !p) {
 				a=z;
 				break;
 			}
-			if (p>=0) fl &= ~ZERO_PAD;
 			p = MAX(p, z-a + !arg.i);
 			break;
 		case 'c':