mirror of https://github.com/mkerrisk/man-pages
mbstowcs.3: Use "%zu" to print 'size_t' in example program
Reported-by: Stefan Puiu <stefan.puiu@gmail.com> Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
parent
6d1a5754de
commit
a810c57939
|
@ -167,8 +167,8 @@ main(int argc, char *argv[])
|
|||
/* Describe the source string to the user */
|
||||
|
||||
printf("Length of source string (excluding terminator):\\n");
|
||||
printf(" %ld bytes\\n", (long) strlen(argv[2]));
|
||||
printf(" %ld multibyte characters\\n\\n", (long) mbslen);
|
||||
printf(" %zu bytes\\n", strlen(argv[2]));
|
||||
printf(" %zu multibyte characters\\n\\n", mbslen);
|
||||
|
||||
/* Allocate wide character string of the desired size. Add 1
|
||||
to allow for terminating null wide character (L\(aq\\0\(aq). */
|
||||
|
@ -187,8 +187,8 @@ main(int argc, char *argv[])
|
|||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
printf("Wide character string is: %ls (%ld characters)\\n",
|
||||
wcs, (long) mbslen);
|
||||
printf("Wide character string is: %ls (%zu characters)\\n",
|
||||
wcs, mbslen);
|
||||
|
||||
/* Now do some inspection of the classes of the characters in
|
||||
the wide character string */
|
||||
|
|
Loading…
Reference in New Issue