Displaying 20 results from an estimated 537 matches for "sscanf".
Did you mean:
scanf
2013 Aug 21
0
[klibc:master] tests: Fix sscanf integer tests
...://git.kernel.org/?p=libs/klibc/klibc.git;a=commit;h=686f1931b7dc102c32b59db638a3082d5c2251e5
Author: maximilian attems <max at stro.at>
AuthorDate: Mon, 10 Jun 2013 18:15:43 -0400
Committer: maximilian attems <max at stro.at>
CommitDate: Wed, 21 Aug 2013 11:50:43 +0200
tests: Fix sscanf integer tests
Drop the double tests that klibc doesn't care about
and that where hence failing in the first place.
Check the returned integer values too.
Fixes Bug: https://bugs.gentoo.org/show_bug.cgi?id=464908
Reported-by: Mike Pagano <mpagano at gentoo.org>
Signed-off-by: maximilia...
2013 Jun 09
2
[PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
sscanf can take an integer which specifies the maximum field width.
In this test, the field width is 1 and the input is a negative number so
the test fails.
This patch increases the maximum field width to 2.
Signed-off-by: Mike Pagano <mpagano at gentoo.org>
---
usr/klibc/tests/sscanf.c | 2 +-
1...
2013 Jun 10
0
[PATCH 1/1, RESEND] tests: Fix sscanf test where width = 1 and integer is negative
Sorry for the previous HTML message. This time in plain text.
sscanf can take an integer which specifies the maximum field width. In this test, the field width is 1 and the input is a negative number sothe test fails.
This patch increases the maximum field width to 2.
Signed-off-by: Mike Pagano <mpagano at gentoo.org>
---
usr/klibc/tests/sscanf.c | 2 +-
1...
2000 Sep 13
0
vq: postbeta2 patch
...branch_postbeta2/vq/bookutil.c vorbis-postb2/vq/bookutil.c
--- branch_postbeta2/vq/bookutil.c Thu Aug 31 05:00:02 2000
+++ vorbis-postb2/vq/bookutil.c Wed Sep 13 17:59:15 2000
@@ -309,5 +309,5 @@
c->pigeon_tree=p=calloc(1,sizeof(encode_aux_pigeonhole));
line=get_line(in);
- if(sscanf(line,"%lf, %lf, %d, %d",&(p->min),&(p->del),
+ if(sscanf(line,"%f, %f, %d, %d",&(p->min),&(p->del),
&(p->mapentries),&(p->quantvals))!=4){
fprintf(stderr,"5: syntax in %s in line:\t %s",filename,line);
d...
2010 May 25
2
Little t38 bug?
...Grandstream devices and the result is always the same.
Patton ignores the parameter and sends the fax at 9600.
Grandstream doesn't, and all the faxes are going in and out at 2400.
Looking at the code I found this in chan_sip.c (line 7736):
if ((sscanf(a, "T38FaxMaxBuffer:%30u", &x) == 1)) {
ast_debug(3, "MaxBufferSize:%d\n", x);
found = TRUE;
} else if ((sscanf(a, "T38MaxBitRate:%30u", &x) == 1) || (sscanf(a, "T38FaxMaxRate:%30u", &x) == 1)) {...
2008 Feb 06
2
Problem with bestfcom and old Ferrups
I have an old (1997) Best Ferrups (model FE18KVA) that I am trying to
monitor for the first time, but all the Best drivers fail to communicate
with it.
In ups_sync() in bestuferrups.c and bestfcom.c, the "time" command is
sent and a one-line response is read. However, on my UPS, that command
returns the current time and then prompts for a new time setting. I
worked around that by just
2012 Sep 14
1
[PATCH] xenpm: make argument parsing and error handling more consistent
...ENABLED 1
static xc_interface *xc_handle;
-static int max_cpu_nr;
+static unsigned int max_cpu_nr;
/* help message */
void show_help(void)
@@ -77,6 +77,33 @@ void help_func(int argc, char *argv[])
show_help();
}
+static void parse_cpuid(const char *arg, int *cpuid)
+{
+ if ( sscanf(arg, "%d", cpuid) != 1 || *cpuid < 0 )
+ {
+ if ( strcasecmp(arg, "all") )
+ {
+ fprintf(stderr, "Invalid CPU identifier: ''%s''\n", arg);
+ exit(EINVAL);
+ }
+ *cpuid = -1;
+ }
+}
+
+static voi...
2014 Aug 11
2
[PATCH] p2v: check results of strndup and sscanf
...p2v/ssh.c
@@ -505,7 +505,16 @@ open_data_connection (struct config *config, int *local_port, int *remote_port)
}, ovector, ovecsize)) {
case 100: /* Ephemeral port. */
port_str = strndup (&h->buffer[ovector[2]], ovector[3]-ovector[2]);
- sscanf (port_str, "%d", remote_port);
+ if (port_str == NULL) {
+ set_ssh_error ("not enough memory for strndup");
+ mexp_close (h);
+ return NULL;
+ }
+ if (sscanf (port_str, "%d", remote_port) != 1) {
+ set_ssh_error ("cannot extract the po...
2015 Feb 02
0
[PATCH 2/2] New API: btfs_scrub_status.
...errors: 0
+ * last_physical: 10301341696
+ *
+ * or:
+ *
+ * strub status for 346121d1-1847-40f8-9b7b-2bf3d539c68f
+ * no stats available
+ */
+ line = lines[1];
+ if (STREQ (line, "\tno stats available"))
+ return ret;
+
+ line = lines[2];
+ if (sscanf (line, "\tdata_extents_scrubbed: %" SCNu64,
+ &ret->btrfsscrub_data_extents_scrubbed) != 1)
+ goto error;
+ line = lines[3];
+ if (sscanf (line, "\ttree_extents_scrubbed: %" SCNu64,
+ &ret->btrfsscrub_tree_extents_scrubbed) != 1)
+...
2019 Sep 20
0
sscanf/stroul (was: Re: [PATCH nbdkit v3 2/3] Add new retry filter.)
...7AM -0500, Eric Blake wrote:
> > +static int
> > +retry_config (nbdkit_next_config *next, void *nxdata,
> > + const char *key, const char *value)
> > +{
> > + int r;
> > +
> > + if (strcmp (key, "retries") == 0) {
> > + if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
> > + nbdkit_error ("cannot parse retries: %s", value);
> > + return -1;
> > + }
> > + }
> > + else if (strcmp (key, "retry-delay") == 0) {
> > + if (sscanf (val...
2015 Feb 11
0
[PATCH v3 2/2] New API: btfs_scrub_status
...+ *
+ * or:
+ *
+ * scrub status for 346121d1-1847-40f8-9b7b-2bf3d539c68f
+ * no stats available
+ */
+ for (i = 1; lines[i] != NULL; ++i) {
+ if ((i == 1) && STREQ (lines[i], "\tno stats available"))
+ return ret;
+ else if ((i == 2) && sscanf (lines[i], "\tdata_extents_scrubbed: %" SCNu64,
+ &ret->btrfsscrub_data_extents_scrubbed) != 1)
+ goto error;
+ else if ((i == 3) && sscanf (lines[i], "\ttree_extents_scrubbed: %" SCNu64,
+ &a...
2015 Feb 02
5
[PATCH 1/2] New API: btrfs_balance_status
...uot;running");
+ else if (STREQ (lines[0] + ovector[2], "paused"))
+ ret->btrfsbalance_status = strdup("paused");
+ else {
+ reply_with_error ("unexpected output from 'btrfs balance status' command: %s", lines[0]);
+ goto error;
+ }
+
+ if (sscanf (lines[1], "%" SCNu64 " out of about %" SCNu64
+ " chunks balanced (%" SCNu64 " considered), %" SCNu64 "%% left",
+ &ret->btrfsbalance_balanced, &ret->btrfsbalance_total,
+ &ret->btrfsbalan...
2003 Oct 21
2
Fwd: Re: Bus Error with OpenSSH 3.7.1p2 on Solaris 8, SPARC 64-bit
The story of this problem, AFAIK, is that Solaris 8 YASSP and JASS and vigilant/paranoid sysadmins have been known to set a restricitve umask in /etc/default/login. OpenSSH compatibility for Solaris 8 has been spotty at times for sparcv9 targets. This time, when a sparcv9 binary tries to sscanf(3C) the numeric umask as a long octal and put it in a mode_t, SIGBUS happens.
What this looks like in real life is: You are running a 64 bit OpenSSH_3.7.1p2
sshd on Solaris 8, and you have enforced UMASK in /etc/default/login. You try to log into this sshd, but after all the authentication and cha...
2011 Jun 11
1
isohybrid.c patch: to support hex parameters
...it was brought to notice by Mr Steffen(snwint at suse.de) that
----
> syslinux 4 comes with a C-rewrite of isohybrid. Unfortunately the option
> parsing has changed: it no longer accepts hex numbers (0x...). Was this
> intentional or can we have the old behaviour back (say, changing
> sscanf(%u) -> sscanf(%i))?
>
I've made the changes to the current git repository and below is the patch(also attached) to fix this issue.
Could you please have a look at it and sign off this change?
===
diff --git a/utils/isohybrid.c b/utils/isohybrid.c
index 7ee9a7f..8a60531 100644
--- a/ut...
2014 Aug 07
3
[PATCH] rescue: fix sscanf placeholders for --smp and --memsize
...--git a/rescue/rescue.c b/rescue/rescue.c
index dc56d4b..1c556e5 100644
--- a/rescue/rescue.c
+++ b/rescue/rescue.c
@@ -157,7 +157,7 @@ main (int argc, char *argv[])
else
format = optarg;
} else if (STREQ (long_options[option_index].name, "smp")) {
- if (sscanf (optarg, "%u", &smp) != 1) {
+ if (sscanf (optarg, "%d", &smp) != 1) {
fprintf (stderr, _("%s: could not parse --smp parameter '%s'\n"),
program_name, optarg);
exit (EXIT_FAILURE);
@@ -208,11 +208,19 @@ m...
2013 Aug 20
0
[PATCH 1/1] tests: Fix sscanf test where width = 1 and integer is negative
sorry for the late reply, checking all the backlog now.
On Sat, 08 Jun 2013, Mike Pagano wrote:
> sscanf can take an integer which specifies the maximum field width.
> In this test, the field width is 1 and the input is a negative number so
> the test fails.
>
> This patch increases the maximum field width to 2.
thanks, but can you post the failure you are seeing?
The one I see is relat...
2019 Sep 19
5
Re: [PATCH nbdkit v3 2/3] Add new retry filter.
....bss for a slightly larger binary), but here
it makes sense.
> +
> +static int
> +retry_config (nbdkit_next_config *next, void *nxdata,
> + const char *key, const char *value)
> +{
> + int r;
> +
> + if (strcmp (key, "retries") == 0) {
> + if (sscanf (value, "%d", &retries) != 1 || retries < 0) {
> + nbdkit_error ("cannot parse retries: %s", value);
> + return -1;
> + }
> + }
> + else if (strcmp (key, "retry-delay") == 0) {
> + if (sscanf (value, "%d", &initi...
2015 Feb 03
2
[PATCH v2 0/2] add btrfs_balance_status and btrfs_scrub_status
changes in v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status.
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
generator/structs.ml | 34 ++++
2015 Feb 11
4
[PATCH v3 0/2] add btrfs_balance_status and btrfs_scrub_status
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c | 263 +++++++++++++++++++++++++++++++
generator/actions.ml | 26 +++
2015 Feb 15
4
[PATCH v5 0/2] add btrfs_balance_status and btrfs_scrub_status
v5:
- fix tests failure
v4:
- add reply_with_error when nlines < 1
- remove `i == X' tests.
v3:
- rebase on upstream
- fix some comments
v2:
- add check for the length of lines[]
- the code parsing 'btrfs scrub -R status' output is changed into a loop
Hu Tao (2):
New API: btrfs_balance_status
New API: btfs_scrub_status
daemon/btrfs.c