search for: strchr

Displaying 20 results from an estimated 812 matches for "strchr".

2014 Mar 20
5
[PATCH 1/3] builder/virt-index-validate: try to cleanup in any occasion
...parse_context_free (&context); fprintf (stderr, _("%s: %s contains comments which will not work with virt-builder 1.24.1\n"), program_name, input); exit (EXIT_FAILURE); @@ -134,6 +138,7 @@ main (int argc, char *argv[]) if (compat_1_24_0) { if (strchr (sections->name, '_')) { + parse_context_free (&context); fprintf (stderr, _("%s: %s: section [%s] has invalid characters which will not work with virt-builder 1.24.0\n"), program_name, input, sections->name); exit (EXIT_FAILURE...
1998 Apr 22
0
Patch for print_svid.c
...open("/usr/bin/lpstat -p -D", "r")) != NULL) { char buf[BUFSIZ]; + char buf2[BUFSIZ]; while (fgets(buf, sizeof (buf), fp) != NULL) { printer_t *ptmp; - char *name, *tmp; + char *name, *comment, *tmp; - /* eat "system/device for " */ - if (((tmp = strchr(buf, ' ')) == NULL) || - ((tmp = strchr(++tmp, ' ')) == NULL)) - continue; + /* eat "printer" at start of first line */ + if (((tmp = strchr(buf, ' ')) == NULL)) + break; name = ++tmp; - /* truncate the ": ..." */ - if ((tmp = st...
2014 Nov 17
1
[PATCH] inspection: deb: Seperate epoch field from version
...E char *name = NULL, *version = NULL, *release = NULL, *arch = NULL; int installed_flag = 0; @@ -482,23 +483,31 @@ list_applications_deb (guestfs_h *g, struct inspect_fs *fs) else if (STRPREFIX (line, "Version: ")) { free (version); free (release); - char *p = strchr (&line[9], '-'); - if (p) { - *p = '\0'; - version = safe_strdup (g, &line[9]); - release = safe_strdup (g, p+1); + char *p1, *p2; + p1 = strchr (&line[9], ':'); + if (p1) { + *p1++ = '\0'; + epoch =...
2020 Apr 03
4
Segfault after compiling wget with dfsan
Hi all, I was trying to compile dfsan with wget. (Just enabling the dfsan feature, without actually making changes to the source code) Without dfsan, I am able to compile and run wget 1.19.5 (available at https://ftp.gnu.org/gnu/wget/wget-1.19.5.tar.gz). But when compiled with dfsan, it encountered a null pointer dereference error. Following an old post:
2011 Jul 08
4
[PATCH 0/4] usr/kinit checkpatch
Various coding style fixes checkpatch warns about. The goal is not to be 100% checkpatch compliant, but to have more consistent coding style. As this is a trivial patch serie, will land in 24 hours in klibc git, unless of course ml review hits a bugger. Checked with size(3) that the generated kinit, fstype, ipconfig and nfsmount are the same. maximilian attems (4): [klibc] ipconfig: reduce
2001 Dec 03
0
Segfault in foreign:read.xport (PR#1192)
I get a segfault when trying to read a SAS transport file with rather long rows using read.xport from package foreign (version 0.4-7). The culprit seems to be these lines in xport_read in SASxport.c: 590 } else { 591 c = strchr(tmpchar, ' '); 592 *c = '\0'; 593 SET_STRING_ELT(VECTOR_ELT(data, k), j, 594 (c == tmpchar) ? R_BlankString : 595 mkChar(tmpchar)); 596...
2014 Nov 24
1
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...snapshots/test1 > > > + * snapshots/test2 > > > + * snapshots/test3 > > > + * > > > + */ > > > + > > > + p = out; > > > + > > > + p = strchr (p, '\n'); > > > + if (p) { > > > + *p = '\0'; > > > + p++; > > > + } > > > + else { > > > > Minor style note: > > } else { > > > > (also in other parts of this patch) > > Though I'm f...
2013 Sep 24
4
[PATCH 1/1] gpxe: fix possible null pointer dereference
...diff --git a/gpxe/src/core/uri.c b/gpxe/src/core/uri.c index 6a1f2e5..4987821 100644 --- a/gpxe/src/core/uri.c +++ b/gpxe/src/core/uri.c @@ -151,7 +151,7 @@ struct uri * parse_uri ( const char *uri_string ) { } /* Split authority into user[:password] and host[:port] portions */ - if ( ( tmp = strchr ( authority, '@' ) ) ) { + if ( authority != NULL && ( tmp = strchr ( authority, '@' ) ) ) { /* Has user[:password] */ *(tmp++) = '\0'; uri->host = tmp; -- 1.7.10.4
2005 Jan 05
1
[PATCH] kinit/nfsmount.c path from bootp
...ot[len]; char *x, *opts; int ret = 0; int a; - if ((path = get_arg(argc, argv, "nfsroot=")) == NULL) { - path = (char *) "/tftpboot/%s"; - } - - if (*path == '\0') { - fprintf(stderr, "Root-NFS: no path\n"); - exit(1); - } - a = 1; - if ((opts = strchr(path, ',')) != NULL) { - *opts++ = '\0'; - argv[a++] = (char *) "-o"; - argv[a++] = opts; - } - for (dev = ifaces; dev; dev = dev->next) { print_device_config(dev); if (dev->ip_server != INADDR_NONE && dev->ip_server != INADDR_ANY) {...
2006 Dec 11
0
Add option to TFTP client to ignore ':' in file name
...TP_CONFIG_STR); exit(0); + case 'l': + literal = 1; + break; case 'm': if ( ++arg >= argc ) usage(EX_USAGE); *************** *** 489,495 **** return; } targ = argv[argc - 1]; ! if (strchr(argv[argc - 1], ':')) { struct hostent *hp; for (n = 1; n < argc - 1; n++) --- 497,503 ---- return; } targ = argv[argc - 1]; ! if (!literal && strchr(argv[argc - 1], ':')) { struct host...
2012 Jan 09
3
[PATCH 1/3] launch: move the filename checking to a wrapper
...changed, 12 insertions(+), 6 deletions(-) diff --git a/src/launch.c b/src/launch.c index ca89b63..8eaaac8 100644 --- a/src/launch.c +++ b/src/launch.c @@ -277,6 +277,16 @@ valid_format_iface (const char *str) return 1; } +static int +check_path (guestfs_h *g, const char *filename) +{ + if (strchr (filename, ',') != NULL) { + error (g, _("filename cannot contain ',' (comma) character")); + return 1; + } + return 0; +} + int guestfs__add_drive_opts (guestfs_h *g, const char *filename, const struct guestfs_add_drive_opts_argv *optar...
2008 Oct 11
1
[PATCH] fstype: Fix ext4/ext4dev probing
...r buf[80], *cp, *t; + + f = fopen("/proc/filesystems", "r"); + if (!f) + return (0); + while (fgets(buf, sizeof(buf), f)) { + cp = buf; + if (!isspace(*cp)) { + while (*cp && !isspace(*cp)) + cp++; + } + while (*cp && isspace(*cp)) + cp++; + if ((t = strchr(cp, '\n')) != NULL) + *t = 0; + if ((t = strchr(cp, '\t')) != NULL) + *t = 0; + if ((t = strchr(cp, ' ')) != NULL) + *t = 0; + if (!strcmp(fs_name, cp)) { + fclose(f); + return (1); + } + } + fclose(f); + return (0); +} + +/* + * Check to see if a filesystem is...
2004 Jul 03
2
Multiple E1s over TDMoE?
When I was trying to run mutiple E1s over TDMoE, the zaptel would drivers complain about too little memory, whenever I added more than 31 channels. Requesting 62 channels in a dynamic span gave me ... span creation failed: Cannot allocate memory upon loading the zaptel drivers. How would you go about running, 8 or 16 say, E1s over TDMoE? Would you create multiple dynamic spans or just one large
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...lags: - > + * Snapshot(s): > + * snapshots/test1 > + * snapshots/test2 > + * snapshots/test3 > + * > + */ > + > + p = out; > + > + p = strchr (p, '\n'); > + if (p) { > + *p = '\0'; > + p++; > + } > + else { Minor style note: } else { (also in other parts of this patch) > + reply_with_error ("truncated output"); I'd print out anyway, to ease debugging failures a bit. >...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
...int nulonly; @@ -1042,16 +1046,76 @@ ifsbreakup(char *string, struct arglist *arglist) ifs = nulonly ? nullstr : realifs; ifsspc = 0; while (p < string + ifsp->endoff) { + int c; + bool isifs; + bool isdefifs; + q = p; - if (*p == (char)CTLESC) - p++; - if (strchr(ifs, *p)) { + c = *p++; + if (c == (char)CTLESC) + c = *p++; + + isifs = strchr(ifs, c); + isdefifs = false; + if (isifs) + isdefifs = strchr(defifs, c); + + /* If only reading one more argument: + * If we have exactly one field, + * read that field without its ter...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix handling of trailing IFS white spaces
...int nulonly; @@ -1042,16 +1046,76 @@ ifsbreakup(char *string, struct arglist *arglist) ifs = nulonly ? nullstr : realifs; ifsspc = 0; while (p < string + ifsp->endoff) { + int c; + bool isifs; + bool isdefifs; + q = p; - if (*p == (char)CTLESC) - p++; - if (strchr(ifs, *p)) { + c = *p++; + if (c == (char)CTLESC) + c = *p++; + + isifs = strchr(ifs, c); + isdefifs = false; + if (isifs) + isdefifs = strchr(defifs, c); + + /* If only reading one more argument: + * If we have exactly one field, + * read that field without its ter...
2020 Feb 12
0
[common PATCH v2 1/1] options: add '--blocksize' option for C-based tools
...\ - if (!mp) \ - error (EXIT_FAILURE, errno, "malloc"); \ - mp->fstype = NULL; \ - mp->options = NULL; \ - mp->mountpoint = (char *) "/"; \ - p = strchr (optarg, ':'); \ - if (p) { \ - *p = '\0'; \ - p++; \ - mp->mountpoint = p; \ - p = strchr (p, ':');...
2017 Jul 03
1
[PATCH] dsync: fix splitting login from host
Using strchr() was splitting login and host at the first occurrence of '@' which leads to troublesome behaviour. When calling strace one would notice the misbehaviour: execve("/usr/sbin/ssh", ["ssh", "-lthomas", "domain.org at 10.8.13.2" using strrch() however s...
2000 Dec 27
1
PrintLastLog option is not honored
.../ | last_login_time = get_last_login_time(pw->pw_uid, pw->pw_name, | buf, sizeof(buf)); |- if (last_login_time != 0) { |+ if (last_login_time != 0 && options.print_lastlog) { | time_string = ctime(&last_login_time); | if (strchr(time_string, '\n')) | *strchr(time_string, '\n') = 0; Ciao Christian -- Debian Developer and Quality Assurance Team Member 1024/26CC7853 31E6 A8CA 68FC 284F 7D16 63EC A9E6 67FF 26CC 7853 -------------- next part -------------- A non-text...
2020 Feb 11
1
[common PATCH] options: add '--blocksize' option for C-based tools
...\ - if (!mp) \ - error (EXIT_FAILURE, errno, "malloc"); \ - mp->fstype = NULL; \ - mp->options = NULL; \ - mp->mountpoint = (char *) "/"; \ - p = strchr (optarg, ':'); \ - if (p) { \ - *p = '\0'; \ - p++; \ - mp->mountpoint = p; \ - p = strchr (p, ':');...