search for: scanf

Displaying 20 results from an estimated 202 matches for "scanf".

2012 Jan 21
1
[PATCH] include/checkpatch: Prefer __scanf to __attribute__((format(scanf, ...)
It's equivalent to __printf, so prefer __scanf. Signed-off-by: Joe Perches <joe at perches.com> --- include/linux/compiler-gcc.h | 3 ++- include/linux/kernel.h | 8 ++++---- include/xen/xenbus.h | 4 ++-- scripts/checkpatch.pl | 6 ++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/i...
2012 Jan 21
1
[PATCH] include/checkpatch: Prefer __scanf to __attribute__((format(scanf, ...)
It's equivalent to __printf, so prefer __scanf. Signed-off-by: Joe Perches <joe at perches.com> --- include/linux/compiler-gcc.h | 3 ++- include/linux/kernel.h | 8 ++++---- include/xen/xenbus.h | 4 ++-- scripts/checkpatch.pl | 6 ++++++ 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/i...
2004 Dec 03
1
Difficulty implementing "scales" in a lattice plot
...hed and examined 30 or so hits on Dr. Baron's search site, looked through my MASS book, my Data Analysis and Graphics Using R book, R news articles, and I have in my hand the lattice package instructions and have read and re-read the "scales" section. Here is the problem I am having. Scanf is a factor with 20 levels and the mean values for these levels are being plotted with CIs. I am trying to reduce the text size for the labels for this variable. The first function below does not attempt to set the text size for the y axes, and all works well. xx2 <- with(xx,summarize(q27a,...
2020 May 23
0
Re: RFC: *scanf vs. overflow
...ote: > > > stopping on an initial prefix ... does not admit easily sharing a backend with strto*. > > I don't see why. If the backend has a "stop scanning on integer overflow" flag > (which it would need to have anyway, to support the proposed behavior), then > *scanf can use the flag and strto* can not use it. > > Anyway, this is not an issue for glibc, which has no such backend. It's relevant because you want to propose this for standardization. > > that's contrary to the abstract behavior defined for scanf > > (matching fields syn...
2020 May 22
6
RFC: *scanf vs. overflow
It has long been known that the C specification of *scanf() leaves behavior undefined for things like int i; sscanf("9999999999999999", "%i", &i); C11 7.21.6.2 P12 "Matches an optionally signed integer, whose format is the same as expected for the subject sequence of the strtol function with the value 0 for the base argume...
2020 May 23
0
Re: RFC: *scanf vs. overflow
...t thing > (i.e., report a failure) than the current behavior does. And with luck perhaps > we could eventually get POSIX to standardize this behavior. I'm not really a fan of stopping on an initial prefix. While UB allows anything, that's contrary to the abstract behavior defined for scanf (matching fields syntactically then value conversion) and does not admit easily sharing a backend with strto*. It's also even *more likely* to break programs that don't expect the behavior than just storing a wrapped or clamped value, since all the remaining fields will misalign with the co...
2004 May 30
0
R Wrappers for "scanf-like" c functions.
I'm having difficulty trying to figure out how to write an R wrapper for a C function that has a "scanf-like" argument list. Recall that in C, functions like scanf() return their values through a variable number of arguments whose type and number is determined by a format string. In C this is handled by parsing the format string and then applying the types and functions declared in <stdar...
2002 May 27
0
[Bug 258] New: scanf format not portable
http://bugzilla.mindrot.org/show_bug.cgi?id=258 Summary: scanf format not portable Product: Portable OpenSSH Version: -current Platform: Other OS/Version: other Status: NEW Severity: normal Priority: P2 Component: ssh AssignedTo: openssh-unix-dev at mindrot.org Rep...
2013 Nov 24
0
dovecot patch: do scanf correctly
As far as I can tell, there are two places in which dovecot does not use scanf properly. This patch should fix that. -------------------------------------------------------------------------------- diff -r 8a3d0426f514 src/lib-dns/dns-lookup.c --- a/src/lib-dns/dns-lookup.c Sat Nov 23 23:22:09 2013 +0000 +++ b/src/lib-dns/dns-lookup.c Sun Nov 24 06:30:12 2013 +0100 @@ -102...
2019 Feb 02
2
[llvm-xray] llvm-xray cannot log every functions
...) __attribute__((xray_always_instrument)); void display(int mult[][10], int rowFirst, int columnSecond); int main() { int firstMatrix[10][10], secondMatrix[10][10], mult[10][10], rowFirst, columnFirst, rowSecond, columnSecond, i, j, k; printf("Enter rows and column for first matrix: "); scanf("%d %d", &rowFirst, &columnFirst); printf("Enter rows and column for second matrix: "); scanf("%d %d", &rowSecond, &columnSecond); // If colum of first matrix in not equal to row of second matrix, asking user to enter the size of matrix again. while (...
2020 May 23
0
Re: RFC: *scanf vs. overflow
The context to this is that nbdkit uses sscanf to parse simple file formats in various places, eg: https://github.com/libguestfs/nbdkit/blob/b23f4f53cf71326f1dba481f64f7f182c20fa3dc/plugins/data/format.c#L171-L172 https://github.com/libguestfs/nbdkit/blob/b23f4f53cf71326f1dba481f64f7f182c20fa3dc/filters/ddrescue/ddrescue.c#L98 We can only do...
2002 May 27
0
[Bug 258] scanf format not portable
http://bugzilla.mindrot.org/show_bug.cgi?id=258 ------- Additional Comments From liug at mama.indstate.edu 2002-05-28 02:53 ------- Here are some more info I gathered from the Watcom newsgroup: The C99 draft explicitly said that: "If a - character is in the scanlist and is not the first, nor the second where the first character is a ^, nor the last character, the behavior is
2003 May 14
0
[Bug 258] scanf format not portable
http://bugzilla.mindrot.org/show_bug.cgi?id=258 djm at mindrot.org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED ------- Additional Comments From djm at mindrot.org 2003-05-14 22:26
2002 Nov 07
5
From RISKS: secret scrubbing code removed by optimizers
This showed up in RISKS and no one has mentioned it here yet, so.. OpenSSH contains lots of code like: char *password = read_passphrase(prompt, 0); [do stuff] memset(password, 0, strlen(password));
2008 Feb 24
0
Zeroing sensitive memory chunks [Was: Security Flaw in Popular Disk Encryption Technologies]
...the local array. The test program is: ----- #include <stdio.h> #include <string.h> #include <strings.h> #define bar(n) \ void bar ## n(void) \ { \ char b[n]; \ scanf("%" #n "s", b); \ memset(b, '\0', sizeof(b)); \ } #define foo(n) \ void foo ## n(void) \ { \ char b[n]; \ scanf("%" #n...
2010 Mar 04
1
[LLVMdev] Doubt with GVNPRE
Hi, I have a program as: int main(int argc, char **argv) { int a,b,k,l; scanf("%d%d",&a,&b); if (argc > 1) { k=a+b; } else { k=5; } l=a+b; printf("%d,%d",k,l); return 0; } Now i run the following on it: llvm-gcc -O1 -emit-llvm -c -o 1.bc 1.c llvm-dis 1.bc -o 1.ll...
2003 Apr 05
1
flock a file in a NT server
...propper file locking? Windows machines lock without problems. Here it is a short verson of the test program I'm using: f=open("/mnt/smb/file",O_RDWR|O_CREAT|O_APPEND,S_IRUSR|S_IWUSR); if (flock(f, LOCK_EX)) { printf("Error locking"); exit; } printf("Text: "); scanf("%s",c); strcat(c,"\n"); write(f,c,strlen(c)); printf("Say something to quit: "); scanf("%s",c); if (flock(f, LOCK_UN)) { printf("Error unlocking"); exit; } close(f); Albert Cervera Areny
2014 Aug 08
4
[LLVMdev] Efficient Pattern matching in Instruction Combine
...nt code and highlighted important one in following example) *e.x. * ((~A & B) | A) --> (A | B) ; Code is implemented for this already *C code :* suyog at suyog-Inspiron-N5010:~$ cat 1.c #include<stdio.h> int cal(int a, int b) { *return ((~a & b) | a);* } int main(){ int a, b; scanf("%d %d", &a, &b); return cal(a,b); } LLVM IR at O0 : suyog at suyog-Inspiron-N5010:~$ Open/rbuild/bin/clang -S -O0 -emit-llvm 1.c ; Function Attrs: nounwind *define i32 @cal(i32 %a, i32 %b) #0 { %1 = xor i32 %a, -1 %2 = and i32 %1, %b %3 = or i32 %2, %a ret i32 %3* } ;...
2004 Aug 27
1
Keyboard input into functions
...at.math.ethz.ch [mailto:r-help-bounces at stat.math.ethz.ch] On Behalf Of Neil Leonard Sent: Friday, August 27, 2004 2:04 PM To: r-help at stat.math.ethz.ch Subject: [R] Keyboard input into functions Hi, Does anybody know if it is possible to have keyboard input into functions? Kind of like 'scanf()' in C. I want to write a function that asks me what to put in certain variables. Thanks, Neil ______________________________________________ R-help at stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/po...
2006 Jan 12
5
dtrace and follow fork
I am trying to use dtrace to trace all sscanf calls. I am able to use pid provider for this. But my application forks off children at times to handle requests. Is there a way I can stop the child process immediately after it is started so that I can attach a pid provider to that and trace the scanf calls in it? I have tried usi...