Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 350346 Details for
Bug 472592
net-misc/iputils[idn] breaks number parsing of command line flags by using locale-dependent strtod()
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
fallback to C locale if strtod() fails
iputils-locale.patch (text/plain), 702 bytes, created by
Sergey Fionov
on 2013-06-07 15:51:03 UTC
(
hide
)
Description:
fallback to C locale if strtod() fails
Filename:
MIME Type:
Creator:
Sergey Fionov
Created:
2013-06-07 15:51:03 UTC
Size:
702 bytes
patch
obsolete
>diff --git a/ping_common.c b/ping_common.c >index 0342e1a..1ab380c 100644 >--- a/ping_common.c >+++ b/ping_common.c >@@ -271,6 +271,21 @@ void common_options(int ch) > errno = 0; > dbl = strtod(optarg, &ep); > >+ if (errno || *ep != '\0') { >+ char *saved_locale; >+ int saved_errno; >+ saved_locale = strdup(setlocale(LC_NUMERIC, NULL)); >+ setlocale(LC_NUMERIC, "C"); >+ >+ errno = 0; >+ dbl = strtod(optarg, &ep); >+ saved_errno = errno; >+ >+ setlocale(LC_NUMERIC, saved_locale); >+ free(saved_locale); >+ errno = saved_errno; >+ } >+ > if (errno || *ep != '\0' || > !finite(dbl) || dbl < 0.0 || dbl >= (double)INT_MAX / 1000 - 1.0) { > fprintf(stderr, "ping: bad timing interval\n");
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 472592
: 350346