Changeset 94f6df7 in mainline
- Timestamp:
- 2012-04-15T06:18:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f682f5a
- Parents:
- 6484602
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/print/print1.c
r6484602 r94f6df7 42 42 43 43 TPRINTF("Testing printf(\"%%8.10s\", \"text\"):\n"); 44 TPRINTF("Expected output: \" text\"\n");44 TPRINTF("Expected output: \" text\"\n"); 45 45 TPRINTF("Real output: \"%8.10s\"\n\n", "text"); 46 46 … … 49 49 TPRINTF("Real output: \"%8.10s\"\n\n", "very long text"); 50 50 51 TPRINTF("Testing printf(\"%%-*.*s\", 7, 7, \"text\"):\n"); 52 TPRINTF("Expected output: \"text \"\n"); 53 TPRINTF("Real output: \"%-*.*s\"\n\n", 7, 7, "text"); 54 51 55 return NULL; 52 56 } -
uspace/lib/c/generic/io/printf_core.c
r6484602 r94f6df7 283 283 /* Print leading spaces. */ 284 284 size_t strw = str_length(str); 285 if (precision == 0 )285 if (precision == 0 || precision > strw) 286 286 precision = strw; 287 287 … … 331 331 /* Print leading spaces. */ 332 332 size_t strw = wstr_length(str); 333 if (precision == 0 )333 if (precision == 0 || precision > strw) 334 334 precision = strw; 335 335
Note:
See TracChangeset
for help on using the changeset viewer.