diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-02-21 21:29:58 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-02-22 13:32:47 -0500 |
commit | 435f73337eff129943249b0d59aad50c8df5bd2e (patch) | |
tree | 02a2611aab9f58c376fcb5017f45be75269d5499 /libc | |
parent | 9bc14fb42980b738abfcd8be8cffcca0937b5220 (diff) |
tempname: fix int precision warnings
The printf precision takes an integer, not a size_t. Otherwise we get:
libc/misc/internals/tempname.c: In function '___path_search':
libc/misc/internals/tempname.c:116: warning:
field precision should have type 'int', but argument 3 has type 'size_t'
field precision should have type 'int', but argument 5 has type 'size_t'
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'libc')
-rw-r--r-- | libc/misc/internals/tempname.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c index 4145c9478..0db28455b 100644 --- a/libc/misc/internals/tempname.c +++ b/libc/misc/internals/tempname.c @@ -62,7 +62,10 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di const char *pfx /*, int try_tmpdir*/) { /*const char *d; */ - size_t dlen, plen; + /* dir and pfx lengths should always fit into an int, + so don't bother using size_t here. Especially since + the printf func requires an int for precision (%*s). */ + int dlen, plen; if (!pfx || !pfx[0]) { |