public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/14586] New: sscanf: "%[^a]s %s" stopped working
@ 2012-09-15 19:23 temp78593 at mutluit dot com
2012-09-15 19:24 ` [Bug libc/14586] " temp78593 at mutluit dot com
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: temp78593 at mutluit dot com @ 2012-09-15 19:23 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=14586
Bug #: 14586
Summary: sscanf: "%[^a]s %s" stopped working
Product: glibc
Version: 2.13
Status: NEW
Severity: critical
Priority: P2
Component: libc
AssignedTo: unassigned@sourceware.org
ReportedBy: temp78593@mutluit.com
CC: drepper.fsp@gmail.com
Classification: Unclassified
#include <cstdio>
#include <cstdlib>
int main()
{
const char* psz = " PROTO=TCP SPT=6004 DPT=26532 ";
char szProto[256] = "";
unsigned short usSrcPort = 0, usDstPort = 0;
const int c = sscanf(psz, " PROTO=%255[^ \t\n]s SPT=%hu DPT=%hu",
szProto, &usSrcPort, &usDstPort);
printf("%s\n", c == 3 ? "OK" : "ERROR");
//...
return 0;
}
It fills only the first field --> c=1 --> ERROR
This code was working fine in prev. compiler/library versions.
# g++ --version
g++ (Debian 4.7.1-7) 4.7.1
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libc/14586] sscanf: "%[^a]s %s" stopped working
2012-09-15 19:23 [Bug libc/14586] New: sscanf: "%[^a]s %s" stopped working temp78593 at mutluit dot com
@ 2012-09-15 19:24 ` temp78593 at mutluit dot com
2012-09-15 19:43 ` temp78593 at mutluit dot com
2014-06-13 14:01 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: temp78593 at mutluit dot com @ 2012-09-15 19:24 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=14586
Uenal Mutlu <temp78593 at mutluit dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |temp78593 at mutluit dot
| |com
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libc/14586] sscanf: "%[^a]s %s" stopped working
2012-09-15 19:23 [Bug libc/14586] New: sscanf: "%[^a]s %s" stopped working temp78593 at mutluit dot com
2012-09-15 19:24 ` [Bug libc/14586] " temp78593 at mutluit dot com
@ 2012-09-15 19:43 ` temp78593 at mutluit dot com
2014-06-13 14:01 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: temp78593 at mutluit dot com @ 2012-09-15 19:43 UTC (permalink / raw)
To: glibc-bugs
http://sourceware.org/bugzilla/show_bug.cgi?id=14586
Uenal Mutlu <temp78593 at mutluit dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |WONTFIX
--- Comment #1 from Uenal Mutlu <temp78593 at mutluit dot com> 2012-09-15 19:43:15 UTC ---
It seems the format string I had used " PROTO=%255[^ \t\n]s SPT=%hu DPT=%hu"
isn't supported anymore.
Instead one must use " PROTO=%255[^ \t\n] SPT=%hu DPT=%hu"
Ie. omitting the 's' after set...
Ok, I can live with that... the bugreport can be closed.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug libc/14586] sscanf: "%[^a]s %s" stopped working
2012-09-15 19:23 [Bug libc/14586] New: sscanf: "%[^a]s %s" stopped working temp78593 at mutluit dot com
2012-09-15 19:24 ` [Bug libc/14586] " temp78593 at mutluit dot com
2012-09-15 19:43 ` temp78593 at mutluit dot com
@ 2014-06-13 14:01 ` fweimer at redhat dot com
2 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-13 14:01 UTC (permalink / raw)
To: glibc-bugs
https://sourceware.org/bugzilla/show_bug.cgi?id=14586
Florian Weimer <fweimer at redhat dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Flags| |security-
--
You are receiving this mail because:
You are on the CC list for the bug.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2014-06-13 14:01 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-15 19:23 [Bug libc/14586] New: sscanf: "%[^a]s %s" stopped working temp78593 at mutluit dot com
2012-09-15 19:24 ` [Bug libc/14586] " temp78593 at mutluit dot com
2012-09-15 19:43 ` temp78593 at mutluit dot com
2014-06-13 14:01 ` fweimer at redhat dot com
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).