Displaying 20 results from an estimated 156 matches for "strcspn".
2015 Jun 10
2
[LLVMdev] Why buildbot sanitizer-ppc64-linux1 blames r239459?
I'm trying to understand why the buildbot sanitizer-ppc64-linux1 fails due
to my latest patch. It was in llvm::GlobalValue while the reported failure
is:
strcspn-2.c.tmp:
/home/buildbots/sanitizerslave1/sanitizer-ppc64-1/build/llvm/projects/compiler-rt/test/asan/TestCases/strcspn-2.c:17:
int main(int, char **): Assertion `r == sizeof(s1) - 1' failed.
where strcspn-2.c (below) tests the strcspn function and does not use any
header from LLVM, completely...
2007 Aug 24
2
[git patch] klibc bzero, mount fixes + random stuff
...t://brane.itp.tuwien.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 +++++-...
2009 Jul 10
1
ogg123 crash
...extra picky (manpage available online
at http://www.openbsd.org/cgi-bin/man.cgi?query=malloc.conf - Claudio
was using MALLOC_OPTIONS=FGJ) These options quite often uncover malloc
related bugs and are a useful asset when developing code on OpenBSD.
As it turns out, there is a bug in ogg123s use of strcspn(3) - it
should never return 0 unless the '='-sign is the first character
(quite unlikely). Claudio proposed a patch for our portstree to fix
this issue, can someone have a look at the patch to ogg123's
vorbis_comments.c (below) and add this fix to the vorbis-tools
codebase ?
I have sam...
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)
strstr:
* s...
2017 Apr 25
1
[PATCH supermin v2] init: Support root=UUID=... to specify the appliance disk by volume UUID.
v1 -> v2:
- I fixed the end condition of the loop in parse_root_uuid.
- Retested.
Didn't change the busy wait loop into a function or macro,
as per discussion on IRC.
Rich.
2013 Sep 11
0
[LLVMdev] removing unnecessary ZEXT
...hank you for the suggestion.
I've looked at CodeGenPrepare.cpp and MoveExtToFormExtLoad() is never run.
I also notice that the ARM target produces the same additional register usage (copy) and zero extending (of the copy).
(See the usage of r3 &r5 and also r12 & r4 in attached file arm-strcspn.s, my understanding is that 'ldrb' is zero extending.)
Here is a simplified example:
void test(const char *c) {
do {
if (!*c) break;
++c;
} while (*c);
}
And in IR form:
define void @test(i8* nocapture %c) {
entry:
%.pre = load i8* %c,...
2017 Apr 19
1
[PATCH supermin] init: Support root=UUID=... to specify the appliance disk by volume UUID.
...ar *mount_options = "";
#define NANOSLEEP(ns) do { \
@@ -181,46 +185,59 @@ main ()
exit (EXIT_FAILURE);
}
root += 5;
- if (strncmp (root, "/dev/", 5) == 0)
- root += 5;
- if (strncmp (root, "pmem", 4) == 0)
- dax = 1;
- len = strcspn (root, " ");
- root[len] = '\0';
-
- asprintf (&path, "/sys/block/%s/dev", root);
- for (delay_ns = 250000;
- delay_ns <= MAX_ROOT_WAIT * UINT64_C(1000000000);
- delay_ns *= 2) {
- fp = fopen (path, "r");
- if (fp != NULL)
- b...
2017 Apr 19
6
[PATCH supermin 0/3] Require root= parameter, refactor init.
Require the root= parameter is passed to specify which
root (apppliance) to mount. Libguestfs has done this since 2012.
The other two patches are small code refactorings in the init
program.
Rich.
2013 Sep 11
2
[LLVMdev] removing unnecessary ZEXT
On Sep 10, 2013, at 8:59 AM, Robert Lytton <robert at xmos.com> wrote:
> Hi,
>
> A bit more information.
> I believe my problem lies with the fact that the load is left as 'anyext from i8'.
> On the XCore target we know this will become an 8bit zext load - as there is no 8bit sign extended load!
> If BB#1 were to force the load to a "zext from i8" would
2008 Nov 14
0
(PR#13283) R crashes on sprintf with bad format specification
...the crash. =20
--- sprintf.c (revision 46944)
+++ sprintf.c (working copy)
@@ -103,7 +103,7 @@
else {
/* recognise selected types from Table B-1 of K&R */
/* This is MBCS-OK, as we are in a format spec */
- chunk =3D strcspn(formatString + cur + 1,
"aAdisfeEgGxX%") + 2;
+ chunk =3D strcspn(formatString + cur + 1,
"aAdisSfeEgGxX%") + 2;
if (cur + chunk > n)
error(_("unrecognised format at end of
string"));
The resulting error...
2008 Nov 14
0
(PR#13283) R crashes on sprintf with bad format
...tf.c (revision 46944)
> +++ sprintf.c (working copy)
> @@ -103,7 +103,7 @@
> else {
> /* recognise selected types from Table B-1 of K&R */
> /* This is MBCS-OK, as we are in a format spec */
> - chunk = strcspn(formatString + cur + 1,
> "aAdisfeEgGxX%") + 2;
> + chunk = strcspn(formatString + cur + 1,
> "aAdisSfeEgGxX%") + 2;
> if (cur + chunk > n)
> error(_("unrecognised format at end of
> string&quo...
2009 Aug 21
9
enable -Werror and all of gcc's warning options
Here is a bunch of small patches to make fish/ build
with most warnings enabled:
[1/9] edit.c: avoid warning about signed/unsigned comparison
[2/9] fish.c: avoid warnings
[3/9] tilde.c: avoid a warning
[4/9] fish.c: avoid "assignment discards qualifiers..." warning
[5/9] fish.c: avoid signed/unsigned-comparison warning
[6/9] fish.c: don't perform arithmetic on void*
2014 Jan 22
1
[PATCH] builder: fix small regression in subkey parsing
...deletion(-)
diff --git a/builder/index-scan.l b/builder/index-scan.l
index 7a9618f..e43f82e 100644
--- a/builder/index-scan.l
+++ b/builder/index-scan.l
@@ -65,7 +65,7 @@ extern void yyerror (const char *);
if (yytext[i] == '[') {
size_t j = strcspn (yytext+i+1, "]");
yylval.field->subkey = strndup (yytext+i+1, j);
- i += 1+j+2;
+ i += 1+j+1;
} else {
yylval.field->subkey = NULL;
}
--
1....
2014 Jan 21
0
[PATCH] builder: proper consider subkeys in index files
...dex 9a6a0e3..7a9618f 100644
--- a/builder/index-scan.l
+++ b/builder/index-scan.l
@@ -58,10 +58,17 @@ extern void yyerror (const char *);
/* field=value or field[subfield]=value */
^[A-Za-z0-9_.]+("["[A-Za-z0-9_,.]+"]")?"=".*\n {
- size_t i = strcspn (yytext, "=");
+ size_t i = strcspn (yytext, "=[");
yylval.field = malloc (sizeof (struct field));
yylval.field->next = NULL;
yylval.field->key = strndup (yytext, i);
+...
2017 Apr 19
0
[PATCH supermin 2/3] init: Move variable declarations to the top of the function.
...t.tv_sec = delay_ns / 1000000000;
t.tv_nsec = delay_ns % 1000000000;
nanosleep (&t, NULL);
@@ -205,9 +211,9 @@ main ()
fprintf (stderr, "supermin: picked %s as root device\n", path);
fgets (line, sizeof line, fp);
- int major = atoi (line);
- char *p = line + strcspn (line, ":") + 1;
- int minor = atoi (p);
+ major = atoi (line);
+ p = line + strcspn (line, ":") + 1;
+ minor = atoi (p);
fclose (fp);
if (umount ("/sys") == -1) {
@@ -225,7 +231,7 @@ main ()
}
/* Construct the filesystem mount options. */
- const...
2023 Nov 14
1
[PATCH v3 1/2] Permit %L and %l percent escapes in ssh Include
...ue2, cmdline = 0;
@@ -1951,6 +1952,12 @@ parse_pubkey_algos:
"command-line option");
goto out;
}
+
+ if (gethostname(thishost, sizeof(thishost)) == -1)
+ fatal("gethostname: %s", strerror(errno));
+ strlcpy(shorthost, thishost, sizeof(shorthost));
+ shorthost[strcspn(thishost, ".")] = '\0';
+
value = 0;
while ((arg = argv_next(&ac, &av)) != NULL) {
if (*arg == '\0') {
@@ -1971,11 +1978,14 @@ parse_pubkey_algos:
goto out;
}
if (!path_absolute(arg) && *arg != '~') {
- xasprintf(&arg2,...
2024 Jul 01
1
[PATCH RESEND 1/2] Permit %L and %l percent escapes in Include
...ue2, cmdline = 0;
@@ -1983,6 +1984,12 @@ parse_pubkey_algos:
"command-line option");
goto out;
}
+
+ if (gethostname(thishost, sizeof(thishost)) == -1)
+ fatal("gethostname: %s", strerror(errno));
+ strlcpy(shorthost, thishost, sizeof(shorthost));
+ shorthost[strcspn(thishost, ".")] = '\0';
+
value = 0;
while ((arg = argv_next(&ac, &av)) != NULL) {
if (*arg == '\0') {
@@ -2003,11 +2010,14 @@ parse_pubkey_algos:
goto out;
}
if (!path_absolute(arg) && *arg != '~') {
- xasprintf(&arg2,...
2023 Dec 20
2
[PATCH RESEND 0/2] Permit %L and %l percent escapes in Include
Using these escapes, the include directive can be crafted to include
differing, host-specific configuration.
Ronan Pigott (2):
Permit %L and %l percent escapes in ssh Include
Permit %L and %l percent escapes in sshd Include
readconf.c | 16 +++++++++++++---
servconf.c | 17 ++++++++++++++---
2 files changed, 27 insertions(+), 6 deletions(-)
base-commit:
2024 Jul 01
2
[PATCH RESEND 0/2] Permit %L and %L percent escapes in Include
Using these escapes, the include directive can be crafted to include
differing, host-specific configuration.
Ronan Pigott (2):
Permit %L and %l percent escapes in Include
Permit %L and %l percent escapes in server Include
readconf.c | 16 +++++++++++++---
servconf.c | 21 ++++++++++++++++-----
2 files changed, 29 insertions(+), 8 deletions(-)
base-commit:
2012 Sep 12
2
[PATCH] drm/nouveau: add default debug level override
...char *cmp, size_t len)
@@ -86,7 +93,7 @@ nouveau_boolopt(const char *optstr, const char *opt, bool value)
int
nouveau_dbgopt(const char *optstr, const char *sub)
{
- int mode = 1, level = CONFIG_NOUVEAU_DEBUG_DEFAULT;
+ int mode = 1, level = nouveau_debug_level;
while (optstr) {
int len = strcspn(optstr, ",=");
--
1.7.12