Displaying 20 results from an estimated 118 matches for "strspn".
Did you mean:
strcspn
2010 Oct 10
1
syslinux-4.03-pre4 + MCONFIG.devel + gcc 4.5
I am getting
cc1: warnings being treated as errors
strspn.c: In function 'strxspn':
strspn.c:14:20: error: inlining failed in call to 'set_bit': optimizing for size and code size would grow
strspn.c:32:9: error: called from here
strspn.c:14:20: error: inlining failed in call to 'set_bit': optimizing for size and code size would gro...
2019 Jan 25
0
[klibc:update-dash] builtin: Reject malformed printf specifications with digits after '*'
...+++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c
index d4ae794d..78bf388a 100644
--- a/usr/dash/bltin/printf.c
+++ b/usr/dash/bltin/printf.c
@@ -177,17 +177,24 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
- if (*fmt == '*')
- *param++ = getuintmax(1);
-
- /* skip to possible '.', get following precision */
- fmt += strspn(fmt, SKIP2);
- if (*fmt == '.')
+ if (*fmt == '*') {
++fmt;
- if (*fmt == '*')
*param++ = getuintmax(1...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Reject malformed printf specifications with digits after '*'
...+++++++++++++++--------
1 file changed, 15 insertions(+), 8 deletions(-)
diff --git a/usr/dash/bltin/printf.c b/usr/dash/bltin/printf.c
index d4ae794d..78bf388a 100644
--- a/usr/dash/bltin/printf.c
+++ b/usr/dash/bltin/printf.c
@@ -177,17 +177,24 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
- if (*fmt == '*')
- *param++ = getuintmax(1);
-
- /* skip to possible '.', get following precision */
- fmt += strspn(fmt, SKIP2);
- if (*fmt == '.')
+ if (*fmt == '*') {
++fmt;
- if (*fmt == '*')
*param++ = getuintmax(1...
2010 Nov 05
2
segmentation fault in blazer_status().
...communication like this:
blazer_usb[2985]: Communications with UPS lost: status read failed!
blazer_usb[2985]: Communications with UPS re-established
today i've started ups service again with attached (c)gdb session for final hunting...
Program received signal SIGSEGV, Segmentation fault.
__strspn_c2 (cmd=<value optimized out>) at /usr/include/bits/string2.h:1063
(gdb) up
#1 blazer_status (cmd=<value optimized out>) at blazer.c:214
(gdb) p val
$1 = 0x0
(gdb) p buf
$5 = "(239.0\000\062\063\071.0\000\062\063\071.0\000\060\062\063\000\065\060.0\000\061\063.6\030\064\064.0...
2010 Sep 03
1
[PATCH] New '-o' option to configure server or hosts from command line
...(char *line, const char *fname, int lineno) {
+ config_t *cfg;
+ int len;
+ char *variable, *value, *eol;
+ variable = value = line;
+
+ eol = line + strlen(line);
+ while(strchr("\t ", *--eol))
+ *eol = '\0';
+
+ len = strcspn(value, "\t =");
+ value += len;
+ value += strspn(value, "\t ");
+ if(*value == '=') {
+ value++;
+ value += strspn(value, "\t ");
+ }
+ variable[len] = '\0';
+
+ if(!*value) {
+ const char err[] = "No value for variable";
+ if (fname)
+ logger(LOG_ERR, "%s `%s' on line %d while reading...
2003 Jul 05
2
Unhelpful error message when matching hosts in access list [PATCH]
...error matching address %s: %s\n",
+ tok,
+ gai_strerror(gai));
freeaddrinfo(resa);
return 0;
}
@@ -192,6 +195,18 @@
return ret;
}
+/* Test if a string is likely to be an (IPv4 or IPv6) address */
+static int likely_address(char *s)
+{
+ size_t len = strlen(s);
+
+ return ((strspn(s, ".0123456789") == len)
+#ifdef INET6
+ || (strspn(s, ":0123456789ABCDEFabcdef") == len)
+#endif
+ );
+}
+
static int access_match(char *list, char *addr, char *host)
{
char *tok;
@@ -203,7 +218,9 @@
if (host) strlower(host);
for (tok=strtok(list2," ,\t"...
2007 Aug 24
2
[git patch] klibc bzero, mount fixes + random stuff
...en.ac.at/~mattems/klibc.git maks
with the following shortlog:
maximilian attems (9):
mount: add nodev, noexec and nosuid options
mount: add -n option
cpio: small cleanups
readlink: s/link/link_name/
kinit, mknod: s/(major|minor)/\1_num/
klibc: strcspn, strpbrk, strspn include string.h
resume, kill: axe unused envp usage
devname.c: include kinit.h
add bzero()
and diffstat
usr/include/string.h | 1
usr/kinit/devname.c | 2 +
usr/kinit/do_mounts_md.c | 18 +++++------
usr/kinit/name_to_dev.c | 16 +++++-----
usr/kinit/r...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Remove getintmax in printf
...t getintmax(void);
-static uintmax_t getuintmax(void);
+static uintmax_t getuintmax(int);
static char *getstr(void);
static char *mklong(const char *, const char *);
static void check_conversion(const char *, const char *);
@@ -181,14 +180,14 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
if (*fmt == '*')
- *param++ = getintmax();
+ *param++ = getuintmax(1);
/* skip to possible '.', get following precision */
fmt += strspn(fmt, SKIP2);
if (*fmt == '.')
++fmt;
if (*fmt == '*')
- *param++ = getintmax();
+...
2005 Apr 28
0
[LLVMdev] SimplifyLibCalls Pass -- Help!
...) -> d
* strncpy(d,s,l) -> memcpy(d,s,l,1)
(if s and l are constants)
strpbrk:
* strpbrk(s,a) -> offset_in_for(s,a)
(if s and a are both constant strings)
* strpbrk(s,"") -> 0
* strpbrk(s,a) -> strchr(s,a[0]) (if a is constant string of length
1)
strspn, strcspn:
* strspn(s,a) -> const_int (if both args are constant)
* strspn("",a) -> 0
* strspn(s,"") -> 0
* strcspn(s,a) -> const_int (if both args are constant)
* strcspn("",a) -> 0
* strcspn(s,"") -> strlen(a)
strst...
2014 Feb 04
0
[PATCH 1/3] daemon: parted: refactor sgdisk info parsing code
...line, SEARCH, strlen(SEARCH)) == 0)
+ if (colon - line == fieldlen &&
+ memcmp (line, field, fieldlen) == 0)
{
-#undef SEARCH
/* The value starts after the colon */
char *value = colon + 1;
/* Skip any leading whitespace */
value += strspn (value, " \t");
- /* The value contains only valid GUID characters */
- size_t value_len = strspn (value, "-0123456789ABCDEF");
-
- char *ret = malloc (value_len + 1);
+ /* Extract the actual information from the field. */
+ char *ret = extra...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Remove getintmax in printf
...t getintmax(void);
-static uintmax_t getuintmax(void);
+static uintmax_t getuintmax(int);
static char *getstr(void);
static char *mklong(const char *, const char *);
static void check_conversion(const char *, const char *);
@@ -181,14 +180,14 @@ pc:
/* skip to field width */
fmt += strspn(fmt, SKIP1);
if (*fmt == '*')
- *param++ = getintmax();
+ *param++ = getuintmax(1);
/* skip to possible '.', get following precision */
fmt += strspn(fmt, SKIP2);
if (*fmt == '.')
++fmt;
if (*fmt == '*')
- *param++ = getintmax();
+...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix echo performance regression
...e to ensure the space padding is correct in the presence of
NUL characters. In fact this regression applies to printf %b as
well.
This is easily fixed by making printf %b take the fast path when
no precision/field width modifiers are present.
This patch also changes the second strchurnul call to strspn which
generates slightly better code.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/bltin/printf.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/usr/dash/bltin/p...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix echo performance regression
...e to ensure the space padding is correct in the presence of
NUL characters. In fact this regression applies to printf %b as
well.
This is easily fixed by making printf %b take the fast path when
no precision/field width modifiers are present.
This patch also changes the second strchurnul call to strspn which
generates slightly better code.
Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
Signed-off-by: Ben Hutchings <ben at decadent.org.uk>
---
usr/dash/bltin/printf.c | 19 ++++++++++++-------
1 file changed, 12 insertions(+), 7 deletions(-)
diff --git a/usr/dash/bltin/p...
2014 Dec 01
2
v2.2.15 - make check - Conditional jump or move depends on uninitialised value
On Monday 01 December 2014 03:41 PM, Teemu Huovila wrote:
> On 11/30/2014 05:53 AM, AMM wrote:
>> __strspn_sse42 (in /lib64/libc-2.14.90.so)
> Is it possible that you are encountering this issue? https://bugs.kde.org/show_bug.cgi?id=270925
> Either way, the error seems to stem from your libc implementation (if it is not the valgrind bug).
>
> If possible, upgrade your valgrind, libc etc.
>...
2024 Mar 08
1
Question about ssh-keygen -Y find-principals
On Fri, 8 Mar 2024, Wiktor Kwapisiewicz wrote:
> Hi Damien,
>
> I've verified that slightly modifying your patch makes the problem disappear:
Thanks.
> I've also experimented with the code a bit and found out that if the line that
> skips the whitespace:
> cp = cp + strspn(cp, " \t"); /* skip leading whitespace */
>
> is adjusted slightly to include newline characters:
>
> cp = cp + strspn(cp, " \t\n\r"); /* skip leading whitespace */
> if (*cp == '#' || *cp == '\0') /* <- no change in this line */
>
&g...
2006 Feb 15
1
Dovecot RFC non-compliance: Mailbox names
...d IMAP server).
I looked in the mailing list and source comments, but I could not find any discussion.
Was there any discussion about the imap/commands-util.c:48?
46: /* make sure it even looks valid */
47: sep = mail_storage_get_hierarchy_sep(storage);
48: if (*mailbox == '\0' || strspn(mailbox, "\r\n*%?") != 0) {
49: client_send_tagline(cmd, "NO Invalid mailbox name.");
which is technically not RFC-compliant? I have a feeling it fixes much more important things than it breaks (i.e. LIST/LSUB), but then again we never had complaints from people using thos...
2014 Apr 30
2
make fullcheck fails: strtod/atof and locale
...r_set_apodization()
(-A gauss, -A tukey)
src/share/grabbag/cuesheet.c
local__parse_ms_() <= local__cuesheet_parse_() <= grabbag__cuesheet_parse()
src/share/grabbag/replaygain.c
parse_double_() <= grabbag__replaygain_load_from_vorbiscomment()
*** comments ***
1) local__parse_ms_() have strspn(s, "0123456789.") so decimal comma is not allowed in cuesheets
2) local__parse_timecode_() have strspn(s, "1234567890.,") so comma is allowed in --skip and --until options
3) grabbag__replaygain_load_from_vorbiscomment() uses the following sequence:
setlocale(LC_ALL,...
2018 Sep 08
1
Re: [PATCH nbdkit v2 2/6] main: Tighten up characters permitted in config keys.
...t;
> + "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
> + "0123456789"
> + "._-";
> + size_t i;
> +
> + if (key[0] == '\0')
> + return 0;
> +
> + for (i = 0; i < len; ++i) {
> + if (strchr (allowed, key[i]) == NULL)
Why not use strspn and checking against the length, instead of rolling
an O(n^2) algorithm yourself? The libc version might have optimizations
to run faster, although the speed of this loop is probably in the noise.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization...
2007 Apr 12
2
[PATCH] Make com32 printf obey width-restriction on %s
...sprintf.o srand48.o sscanf.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...
2020 Mar 28
0
[klibc:update-dash] Implement stpcpy() and stpncpy()
...1 +
usr/klibc/tests/stpcpy.c | 75 ++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 121 insertions(+)
diff --git a/usr/include/string.h b/usr/include/string.h
index 0c8c0461..86d5b6c6 100644
--- a/usr/include/string.h
+++ b/usr/include/string.h
@@ -45,5 +45,7 @@ __extern size_t strspn(const char *, const char *);
__extern char *strstr(const char *, const char *);
__extern char *strtok(char *, const char *);
__extern char *strtok_r(char *, const char *, char **);
+__extern char *stpcpy(char *, const char *);
+__extern char *stpncpy(char *, const char *, size_t);
#endif /...