瀏覽代碼

zero precision with zero value should not inhibit prefix/width printing

Rich Felker 13 年之前
父節點
當前提交
cc44d9f201
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      src/stdio/vfprintf.c

+ 4 - 1
src/stdio/vfprintf.c

@@ -570,7 +570,10 @@ 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 (!arg.i && !p) continue;
+			if (!arg.i && !p) {
+				a=z;
+				break;
+			}
 			if (p>=0) fl &= ~ZERO_PAD;
 			p = MAX(p, z-a + !arg.i);
 			break;