search for: strtoimax

Displaying 20 results from an estimated 157 matches for "strtoimax".

2008 Dec 31
1
Checking for strtoumax and strtoimax
Tru64 5.1b PK6 : dovecot 1.1.7 : cc Configuration checks for strtoumax and strtoimax are positive but both are unresolved during compilation. strtoq and strtouq checks are negative. I can modify compat.c to use "unsigned long ret = 0;" in place of strtoumax (does this break anything?) and/but I would like to know how to handle strtoimax. Thanks in advance.
2019 Feb 08
2
[PATCH nbdkit v2] server: utils: Make nbdkit_parse_size to reject negative values
...range (due to negation) but original string passed to a function literally represented negative number. Thus nbdkit_parse_size() treats negative values in a range [-UINT64_MAX; INT64_MIN - 1] as positive values in a range [1; INT64_MAX] due to negation performed by strtoumax(). In this patch: 1. strtoimax() is used instead of strtoumax() to reflect the nature of the 'size' which cannot be negative and is not expected to exceed INT64_MAX. 2. Error reporting separates cases where the string is parsed to a negative value or parsed value overflows (greater then INT64_MAX). Tests: 1. Some more...
2023 Sep 05
1
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
...; > > + /* XXX Should we also parse things like '1.5M'? */ > > > + /* XXX Should we allow hex? If so, hex cannot use scaling suffixes, > > > + * because some of them are valid hex digits. > > > + */ > > > + errno = 0; > > > + size = strtoimax (str, &end, 10); > > > > (1) A further improvement here (likely best done in a separate patch) > > could be to change the type of "size" to "intmax_t", from "int64_t". > > That way, the assignment will be safe even theoretically, *and* the...
2019 Jan 25
0
[klibc:update-dash] mystring: fix "Illegal number" on FreeBSD & macOS for x=; echo $((x))
...ot;Illegal number" on FreeBSD & macOS for x=; echo $((x)) Op 07-03-18 om 06:26 schreef Herbert Xu: > Martijn Dekker <martijn at inlv.org> wrote: >> >>> Since base is always a constant 0 or a constant 10, never a >>> user-provided value, the only error that strtoimax will ever report on >>> glibc systems is ERANGE. Checking only ERANGE therefore preserves the >>> glibc behaviour, and allows the exact same set of errors to be detected >>> on non-glibc systems. >> >> That makes sense, thanks. > > Could you resend your...
2020 Mar 28
0
[klibc:update-dash] dash: mystring: fix "Illegal number" on FreeBSD & macOS for x=; echo $((x))
...o $((x)) [ dash commit 2b3fb53c6940471955631353b8bdb7d5a4677fd1 ] Op 07-03-18 om 06:26 schreef Herbert Xu: > Martijn Dekker <martijn at inlv.org> wrote: >> >>> Since base is always a constant 0 or a constant 10, never a >>> user-provided value, the only error that strtoimax will ever report on >>> glibc systems is ERANGE. Checking only ERANGE therefore preserves the >>> glibc behaviour, and allows the exact same set of errors to be detected >>> on non-glibc systems. >> >> That makes sense, thanks. > > Could you resend your...
2020 Jul 25
0
[klibc:master] tests: Add a trivial test for sysconf()
...-- usr/klibc/tests/Kbuild | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild index c7ca531f..00b701fc 100644 --- a/usr/klibc/tests/Kbuild +++ b/usr/klibc/tests/Kbuild @@ -45,6 +45,7 @@ stdio.shared-y := stdio.o strlcpycat.shared-y := strlcpycat.o strtoimax.shared-y := strtoimax.o strtotime.shared-y := strtotime.o +sysconf.shared-y := sysconf.o testrand48.shared-y := testrand48.o testvsnp.shared-y := testvsnp.o vfork.shared-y := vfork.o
2020 Jul 25
0
[klibc:master] tests: Add a trivial test for sysconf()
...sysconf.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/usr/klibc/tests/Kbuild b/usr/klibc/tests/Kbuild index c7ca531f..00b701fc 100644 --- a/usr/klibc/tests/Kbuild +++ b/usr/klibc/tests/Kbuild @@ -45,6 +45,7 @@ stdio.shared-y := stdio.o strlcpycat.shared-y := strlcpycat.o strtoimax.shared-y := strtoimax.o strtotime.shared-y := strtotime.o +sysconf.shared-y := sysconf.o testrand48.shared-y := testrand48.o testvsnp.shared-y := testvsnp.o vfork.shared-y := vfork.o diff --git a/usr/klibc/tests/sysconf.c b/usr/klibc/tests/sysconf.c new file mode 100644 index 00000000..e32c138...
2005 Aug 07
0
kbuild: add klibc/tests
...+opentest.shared-y := opentest.o +rtsig.shared-y := rtsig.o +setenvtest.shared-y := setenvtest.o +setjmptest.shared-y := setjmptest.o +sigint.shared-y := sigint.o +stat.shared-y := stat.o +statfs.shared-y := statfs.o +strlcpycat.shared-y := strlcpycat.o +strtoimax.shared-y := strtoimax.o +strtotime.shared-y := strtotime.o +testrand48.shared-y := testrand48.o +testvsnp.shared-y := testvsnp.o + +# Cleaning +clean-files := $(static-y) $(shared-y) $(test-files:.c=.o)
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Remove getintmax in printf
...7,8 @@ getstr(void) return val; } -static intmax_t -getintmax(void) -{ - intmax_t val = 0; - char *cp, *ep; - - cp = *gargv; - if (cp == NULL) - goto out; - gargv++; - - val = (unsigned char) cp[1]; - if (*cp == '\"' || *cp == '\'') - goto out; - - errno = 0; - val = strtoimax(cp, &ep, 0); - check_conversion(cp, ep); -out: - return val; -} - static uintmax_t -getuintmax(void) +getuintmax(int sign) { uintmax_t val = 0; char *cp, *ep; @@ -446,7 +423,7 @@ getuintmax(void) goto out; errno = 0; - val = strtoumax(cp, &ep, 0); + val = sign ? strtoimax(cp, &...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Remove getintmax in printf
...7,8 @@ getstr(void) return val; } -static intmax_t -getintmax(void) -{ - intmax_t val = 0; - char *cp, *ep; - - cp = *gargv; - if (cp == NULL) - goto out; - gargv++; - - val = (unsigned char) cp[1]; - if (*cp == '\"' || *cp == '\'') - goto out; - - errno = 0; - val = strtoimax(cp, &ep, 0); - check_conversion(cp, ep); -out: - return val; -} - static uintmax_t -getuintmax(void) +getuintmax(int sign) { uintmax_t val = 0; char *cp, *ep; @@ -446,7 +423,7 @@ getuintmax(void) goto out; errno = 0; - val = strtoumax(cp, &ep, 0); + val = sign ? strtoimax(cp, &...
2008 Nov 21
2
[PATCH] drop root privileges on solaris, request for testing
...gid setresgid \ strtoull strtoll strtouq strtoq \ setpriority quotactl getmntent kqueue kevent backtrace_symbols \ - walkcontext dirfd clearenv malloc_usable_size clock_gettime) + walkcontext dirfd clearenv malloc_usable_size clock_gettime \ + setppriv) dnl strtoimax and strtoumax are macros in HP-UX, so inttypes.h must be included AC_MSG_CHECKING([for strtoimax]) diff -r 8f41c9f3f392 src/master/Makefile.am --- a/src/master/Makefile.am Wed Nov 19 16:11:01 2008 +0200 +++ b/src/master/Makefile.am Wed Nov 19 14:18:36 2008 +0000 @@ -22,6 +22,7 @@ dovecot_SOURCES =...
2007 Apr 12
2
[PATCH] Make com32 printf obey width-restriction on %s
...scanf.o stack.o strcasecmp.o strcat.o \ strchr.o strcmp.o strcpy.o strdup.o strerror.o strlen.o \ - strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o \ + strncasecmp.o strncat.o strncmp.o strncpy.o strndup.o strnlen.o \ strntoimax.o strntoumax.o strrchr.o strsep.o strspn.o strstr.o \ strtoimax.o strtok.o strtol.o strtoll.o strtoul.o strtoull.o \ strtoumax.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \ --- syslinux-3.36/com32/lib/vsnprintf.c.orig 2007-02-10 21:47:08.000000000 +0100 +++ syslinux-3.36/com32/lib/vsnprintf.c 2007-04-12 12:08:54.000000000 +0200 @@ -362,7 +362,7 @@ cas...
2020 Mar 28
0
[klibc:update-dash] Implement stpcpy() and stpncpy()
...sts/Kbuild index c7ca531f..50e38160 100644 --- a/usr/klibc/tests/Kbuild +++ b/usr/klibc/tests/Kbuild @@ -42,6 +42,7 @@ sscanf.shared-y := sscanf.o stat.shared-y := stat.o statfs.shared-y := statfs.o stdio.shared-y := stdio.o +stpcpy.shared-y := stpcpy.o strlcpycat.shared-y := strlcpycat.o strtoimax.shared-y := strtoimax.o strtotime.shared-y := strtotime.o diff --git a/usr/klibc/tests/stpcpy.c b/usr/klibc/tests/stpcpy.c new file mode 100644 index 00000000..4340f61a --- /dev/null +++ b/usr/klibc/tests/stpcpy.c @@ -0,0 +1,75 @@ +#include <stdio.h> +#include <stddef.h> +#include <...
2019 Feb 07
1
[PATCH nbdkit] server: utils: Fix nbdkit_parse_size to correctly handle negative values
From: Nikolay Ivanets <stenavin@gmail.com> nbdkit_parse_size() uses strtoumax() function to parse input strings which states: "if there was a leading minus sign, the negation of the result of the conversion represented as an unsigned value, unless the original (nonnegated) value would overflow." Later validation doesn't catch the situation when parsed value is within the
2010 Oct 29
2
[LLVMdev] "multiple definition of .. " in clang 2.8
...n function `mknod': Hostname.c:(.text+0x4d0): multiple definition of `mknod' av.o:av.c:(.text+0x4d0): first defined here Hostname.o: In function `mknodat': Hostname.c:(.text+0x500): multiple definition of `mknodat' av.o:av.c:(.text+0x500): first defined here Hostname.o: In function `strtoimax': Hostname.c:(.text+0x530): multiple definition of `strtoimax' av.o:av.c:(.text+0x530): first defined here Hostname.o: In function `strtoumax': Hostname.c:(.text+0x540): multiple definition of `strtoumax' av.o:av.c:(.text+0x540): first defined here Hostname.o: In function `wcstoimax...
2023 Sep 03
1
[PATCH nbdkit] server: Move size parsing code (nbdkit_parse_size) to common/include
This is the first part of a pair of patch series which aim to let us use nbdkit_parse_size (or rather, an equivalent common function) in nbdcopy, so we can write: nbdcopy --request-size=32M ... We can't do that now which was annoying me earlier in the week. This commit creates a new function called human_size_parse which is basically nbdkit_parse_size, and turns nbdkit_parse_size into a
2006 Jun 26
0
[klibc 38/43] Simple test suite for klibc
...39 usr/klibc/tests/rtsig.c | 12 usr/klibc/tests/setenvtest.c | 39 usr/klibc/tests/setjmptest.c | 38 usr/klibc/tests/sigint.c | 53 + usr/klibc/tests/stat.c | 63 + usr/klibc/tests/statfs.c | 42 usr/klibc/tests/strlcpycat.c | 111 + usr/klibc/tests/strtoimax.c | 23 usr/klibc/tests/strtotime.c | 25 usr/klibc/tests/testrand48.c | 19 usr/klibc/tests/testvsnp.c | 119 + usr/klibc/tests/vfork.c | 45 27 files changed, 5152 insertions(+), 0 deletions(-) Patch suppressed due to size (64 K), available at: http://www.kernel.org/pu...
2008 Aug 16
1
Minimal COM32 Root Module
...p.o \ exit.o onexit.o \ perror.o qsort.o realloc.o seed48.o snprintf.o \ sprintf.o srand48.o sscanf.o strcasecmp.o \ strdup.o strerror.o strlen.o \ strnlen.o \ strncasecmp.o strncat.o strncmp.o strndup.o \ stpcpy.o stpncpy.o \ strntoimax.o strntoumax.o strrchr.o strstr.o \ strtoimax.o strtol.o strtoll.o strtoul.o strtoull.o \ strtoumax.o vprintf.o vsprintf.o \ asprintf.o vasprintf.o strlcat.o \ vsscanf.o zalloc.o \ \ sys/x86_init_fpu.o math/pow.o math/strtod.o Thank you! Stefan Bucur
2019 Sep 18
2
[PATCH] build: remove unused gnulib modules
...-194,7 +167,6 @@ /save-cwd.m4 /sched_h.m4 /select.m4 -/servent.m4 /setenv.m4 /setlocale.m4 /sh-filename.m4 @@ -202,7 +174,6 @@ /sig_atomic_t.m4 /signalblocking.m4 /signal_h.m4 -/signed.m4 /size_max.m4 /sleep.m4 /snprintf.m4 @@ -230,11 +201,8 @@ /string_h.m4 /strndup.m4 /strnlen.m4 -/strtoimax.m4 /strtoll.m4 -/strtol.m4 /strtoull.m4 -/strtoul.m4 /strtoumax.m4 /symlinkat.m4 /symlink.m4 @@ -252,8 +220,6 @@ /time_h.m4 /timespec.m4 /tls.m4 -/ttyname_r.m4 -/ulonglong.m4 /ungetc.m4 /unistd_h.m4 /unistd-safer.m4 @@ -261,7 +227,6 @@ /unlinkdir.m4 /unlink.m4 /usleep.m4 -/utimbuf.m4...
2009 Dec 10
1
[PATCH] [RFC] lib: add a hex dump lib function
...char *); __extern int rename(const char *, const char *); +__extern void hexdump(const void *, int, int); + #endif /* _STDIO_H */ diff --git a/com32/lib/Makefile b/com32/lib/Makefile index c5b1981..50fd07f 100644 --- a/com32/lib/Makefile +++ b/com32/lib/Makefile @@ -25,7 +25,7 @@ LIBOBJS = \ strtoimax.o strtok.o strtol.o strtoll.o strtoul.o strtoull.o \ strtoumax.o vfprintf.o vprintf.o vsnprintf.o vsprintf.o \ asprintf.o vasprintf.o strlcpy.o strlcat.o \ - vsscanf.o zalloc.o \ + vsscanf.o zalloc.o hexdump.o \ \ opendir.o readdir.o closedir.o getcwd.o chdir.o fdopendir.o \ \...