search for: fscanf

Displaying 20 results from an estimated 63 matches for "fscanf".

Did you mean: scanf
2012 May 25
2
[PATCH] libxl: When checking BDF of existing slots, function should be decimal, not hex
...; Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com> diff --git a/tools/libxl/libxl_pci.c b/tools/libxl/libxl_pci.c --- a/tools/libxl/libxl_pci.c +++ b/tools/libxl/libxl_pci.c @@ -480,7 +480,7 @@ static int pciback_dev_has_slot(libxl__g return ERROR_FAIL; } - while(fscanf(f, "%x:%x:%x.%x\n", &dom, &bus, &dev, &func)==4) { + while(fscanf(f, "%x:%x:%x.%d\n", &dom, &bus, &dev, &func)==4) { if(dom == pcidev->domain && bus == pcidev->bus && dev == pcidev->dev
2001 Oct 17
2
File reading.
...alues). Likewise, with ny>0, lines 4-7 give 1901 values. However, if nx or ny are less than 0, then the data block for lines 2-3 or lines 4-7 will not be present and a generic index is made... In psudo code: --- # get the file handle for the case file fin=fopen(casefile); # read the file in=fscanf(fin,'%f',2); # first 2 numbers in the case file give the size nx=in(1); ny=in(2); # read or construct the x label if nx>0 xlab=fscanf(fin,'%f',nx); else nx=-nx; xlab=0:(nx-1); end # read or construct the y label if ny>0 ylab=fscanf(fin,'%f',ny); else...
2007 Apr 18
1
[Bridge] two fields are missing in brctl output when using /sys
...libbridge/libbridge_devif.c 2007-04-05 16:02:58.2870 22220 -0400 +++ bridge-utils/libbridge/libbridge_devif.c 2007-04-05 14:51:19.362040447 -0 400 @@ -56,7 +56,7 @@ if (!f) fprintf(stderr, "%s: %s\n", dev, strerror(errno)); else { - fscanf(f, "%i", &value); + fscanf(f, "%d", &value); fclose(f); } return value; Please CC replies as I'm not subscribed. -- Jeremy Jackson jerj@coplanar.net Email/Jabber/Google Talk/MSN (519)489-4903 Coplanar Networks http://...
2008 Mar 17
9
Starting WINE
I have RTFM but it is limited on offering help when a problem crops up for a noob who is not a programmer. I DL and installed the WINE program on my Ubuntu 7.10 and can see it on the Applications. Selecting 'Configure Wine' brings up the 'grey' screen but nothing I do to it seems to function. I opened the terminal and typed 'winecfg' and stuff happens like: 'bob at
2007 Jan 25
5
Custom com32
Hi all I've written a basic COM32 module that checks (using the DMI example code) the product and BIOS and if the BIOS is not at the required level, is supposed to exit and boot using a DOS floppy image to flash the BIOS. The problem is that I can't work out how to call the DOS floppy image. Looking at the website, I see "Run Command" AX=0003H via int 22. The image name will
2009 Dec 24
2
[LLVMdev] Problem in External/SPEC/CFP2000/177.mesa/Makefile ?
...it will get 100 frames. But in the spec sources I have, the test folder only contains numbers for 10 frames: $ speccpu2000/benchspec/CFP2000/177.mesa/data $ wc -l test/input/numbers 10 test/input/numbers Generating 100 frames causes undefined behaviour because the program is doing unchecked fscanf on that "numbers" file. Is my version of spec wrong ? If not, can we apply the attached patch ? Thanks, Julien -- Julien Lerouge PGP Key Id: 0xB1964A62 PGP Fingerprint: 392D 4BAD DB8B CE7F 4E5F FA3C 62DB 4AA7 B196 4A62 PGP Public Key from: keyserver.pgp.com -------------- next part --...
2012 Sep 19
1
[PATCH 1/1] lua: Enabling io.read() in Lua.c32 with some restrictions
...} -#ifndef SYSLINUX +#ifndef NO_TMP_FILE static int io_tmpfile (lua_State *L) { FILE **pf = newfile(L); *pf = tmpfile(); @@ -271,7 +277,7 @@ static int io_lines (lua_State *L) { ** ======================================================= */ -#ifndef SYSLINUX +#ifndef NO_READ_NUMBER /* No fscanf() and thus no read_number() */ static int read_number (lua_State *L, FILE *f) { lua_Number d; if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { @@ -283,8 +289,9 @@ static int read_number (lua_State *L, FILE *f) { return 0; /* read fails */ } } +#endif - +#ifndef NO_TEST_EOF /* no bu...
2007 Apr 18
0
[Bridge] libbridge<->sysfs interface - some bugs
...bridge/libbridge_devif.c 2006-09-09 09:30:32.000000000 +0300 +++ /Arrow75/CN3XXX-SDK/linux/embedded_rootfs/build/bridge-utils-1.2/libbrid ge/libbridge_devif.c 2007-01-01 08:22:29.063200300 +0200 @@ -56,7 +56,7 @@ if (!f) fprintf(stderr, "%s: %s\n", dev, strerror(errno)); else { - fscanf(f, "%d", &value); + fscanf(f, "%i", &value); fclose(f); } return value; @@ -282,7 +282,7 @@ char path[SYSFS_PATH_MAX]; FILE *f; - snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_NET "%s/%s", bridge, name); + snprintf(path, SYSFS_PATH_MAX, SYSFS_CLASS_N...
2002 Apr 05
0
=?iso-8859-2?Q?SecurID=20support=20for=20OpenSSH?=
...p;& options.pam_authentication_via_kbd_int) *** openssh-3.1p1/auth2-securid3.c.orig Thu Apr 4 15:21:45 2002 --- openssh-3.1p1/auth2-securid3.c Thu Apr 4 15:38:00 2002 *************** *** 142,148 **** debug("Couldn't read /etc/sdace.txt"); retval = 0; } else { ! fscanf(pfdAcefile, "%s", szVarAce); fclose(pfdAcefile); if (putenv(szVarAce)) { debug("Cannot putenv: %s", szVarAce); --- 142,148 ---- debug("Couldn't read /etc/sdace.txt"); retval = 0; } else { ! fscanf(pfdAcefile, "%511s", szVa...
2009 Dec 24
0
[LLVMdev] Problem in External/SPEC/CFP2000/177.mesa/Makefile ?
...s I have, the test folder only > contains numbers for 10 frames: > > $ speccpu2000/benchspec/CFP2000/177.mesa/data $ wc -l test/input/ > numbers > 10 test/input/numbers > > Generating 100 frames causes undefined behaviour because the program > is > doing unchecked fscanf on that "numbers" file. > > Is my version of spec wrong ? What you say is true in the version I have. > If not, can we apply the attached patch ? I don't think it's ideal. There are 3 input sets, not 2, that's the root of the problem: ifndef RUN_TYPE ifdef SMAL...
2003 Apr 30
5
Scanning data files line-by-line
Hi all, is there a way to read a data file into R line-by-line, akin to what fscanf does in C, say? It seems that "scan" and "read.table" both read the entire data file in at once, whereas "readLines" allows one to read a file partially, but doesn't quite read line-by-line either. I guess what I was hoping to do is something like this: while( l...
2009 Aug 12
2
Wine lags A LOT when programs are started—and getting worse
...sound (ALSA, full hardware acceleration, 44100 Hz, 16 bit, DirectSound driver emulation) > > > Also, I don't know if it's related, but every Wine program I run from the terminal gives this error: > > > Code: > err:reg:SCSI_getprocentry bus id line scan count error (fscanf returns 0, expected 4) > > > Thanks, > Alex Second post: > This problem seems to be getting worse and fast... when I made this thread a few hours ago it was taking me about 30 seconds to start up foobar2000. Right now it just took at least 5 minutes and the amount of skipping whe...
2005 Mar 06
1
Detecting KLIBC from userspace
Hi Currently I am trying to get device-mapper and dmraid ported to compile against klibc. So far there was no real issues, as the only thing they used was fscanf and feof not available presently in klibc (but easy to work around). Other than that there are really no way to easily check for installed klibc's other than trying to mangle the output of klcc (from adjusted configure.in): ----- dnl Enables linking to klibc dnl We need to do this before head...
2007 Jan 19
2
PMI patch for OpenSSH 4.4p1
I have just published a pre-alfa of a patch that has the goal to make OpenSSH aware with PMI. Reference site : http://nutmay.sourceforge.net -- Vincenzo Sciarra
2020 Jul 06
2
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
...-1; > + } > + > + /* Run the command and read the first line of the output. */ > + nbdkit_debug ("%s", cmd); > + fp = popen (cmd, "r"); > + if (fp == NULL) { > + nbdkit_error ("tar: %m"); > + return -1; > + } > + scanned_ok = fscanf (fp, "block %" SCNu64 ": %*s %*s %" SCNu64, > + &offset, &size) == 2; fscanf() parsing an integer is subject to undefined behavior on overflow. (Yes, I know it is a pre-existing and prevalent issue...) > + /* We have to now read and disca...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int value = -1; if (!f) - fprintf(stderr, "%s: %s\n", dev, strerror(errno)); + fprintf(stderr, "%s/%s: %s\n", dev, name, + strerror(errno)); else { fscanf(f, "%i", &value); fclose(f); @@ -73,6 +82,27 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Fetch a string attribute out of sysfs. */ +static void fetch_string(const char *dev, const char *name, char *string) +{ + FI...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int value = -1; if (!f) - fprintf(stderr, "%s: %s\n", dev, strerror(errno)); + fprintf(stderr, "%s/%s: %s\n", dev, name, + strerror(errno)); else { fscanf(f, "%i", &value); fclose(f); @@ -73,6 +82,27 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Fetch a string attribute out of sysfs. */ +static void fetch_string(const char *dev, const char *name, char *string) +{ + FI...
2009 Jun 15
0
[Bridge] [PATCH][RFC] bridge-utils: add basic VEPA support
...id *id) { FILE *f = fpopen(dev, name); @@ -58,7 +66,8 @@ static int fetch_int(const char *dev, const char *name) int value = -1; if (!f) - fprintf(stderr, "%s: %s\n", dev, strerror(errno)); + fprintf(stderr, "%s/%s: %s\n", dev, name, + strerror(errno)); else { fscanf(f, "%i", &value); fclose(f); @@ -73,6 +82,27 @@ static void fetch_tv(const char *dev, const char *name, __jiffies_to_tv(tv, fetch_int(dev, name)); } +/* Fetch a string attribute out of sysfs. */ +static void fetch_string(const char *dev, const char *name, char *string) +{ + FI...
2004 Apr 14
2
again question about nmath/standalone
.../* input x value from file data_2Dx.txt */ in_file=fopen("data_2Dx.txt","r"); if (in_file==NULL) {/*Test for error*/ fprintf(stderr,"Error:Unable to input file from 'data_2Dx.txt'\n"); exit(8); } for( i=0;i<I; i++) for (j=0;j<J;j++) { fscanf(in_file, "%lf\n", &valin, stdin);/* read a single double value in */ x[i][j]=valin; valin=0.0; } fclose(in_file); y=solve(x); for (i=0;i<I;i++) for (j=0;j<J;j++) { printf ("y[%d][%d]=%lf\n", i, j, y[i][j]); } } doub...
2020 Jul 06
0
Re: [PATCH nbdkit 2/2] tar: Rewrite the tar plugin (again), this time in C.
.../* Run the command and read the first line of the output. */ > >+ nbdkit_debug ("%s", cmd); > >+ fp = popen (cmd, "r"); > >+ if (fp == NULL) { > >+ nbdkit_error ("tar: %m"); > >+ return -1; > >+ } > >+ scanned_ok = fscanf (fp, "block %" SCNu64 ": %*s %*s %" SCNu64, > >+ &offset, &size) == 2; > > fscanf() parsing an integer is subject to undefined behavior on > overflow. (Yes, I know it is a pre-existing and prevalent issue...) > > >+ /* We...