aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-07-01 11:26:30 -0400
committerNick Mathewson <nickm@torproject.org>2011-07-01 11:26:30 -0400
commita0ae80788cc12284cd63ac678318f95e1238b257 (patch)
treeaaaf0e1b3076a272903a2bc2ae045041aff28c7e /src/common/compat_libevent.c
parentda62af6f6b369592609d2da43b82abde0bbccfac (diff)
downloadtor-a0ae80788cc12284cd63ac678318f95e1238b257.tar.gz
tor-a0ae80788cc12284cd63ac678318f95e1238b257.zip
Replace 4 more sscanf()s with tor_sscanf()
For some inexplicable reason, Coverity departs from its usual standards of avoiding false positives here, and warns about all sscanf usage, even when the formatting strings are totally safe. Addresses CID # 447, 446.
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index e0c7e3a2da..c338dd6c05 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -264,7 +264,7 @@ tor_decode_libevent_version(const char *v)
/* Try the new preferred "1.4.11-stable" format.
* Also accept "1.4.14b-stable". */
- fields = sscanf(v, "%u.%u.%u%c%c", &major, &minor, &patchlevel, &c, &e);
+ fields = tor_sscanf(v, "%u.%u.%u%c%c", &major, &minor, &patchlevel, &c, &e);
if (fields == 3 ||
((fields == 4 || fields == 5 ) && (c == '-' || c == '_')) ||
(fields == 5 && TOR_ISALPHA(c) && (e == '-' || e == '_'))) {
@@ -272,7 +272,7 @@ tor_decode_libevent_version(const char *v)
}
/* Try the old "1.3e" format. */
- fields = sscanf(v, "%u.%u%c%c", &major, &minor, &c, &extra);
+ fields = tor_sscanf(v, "%u.%u%c%c", &major, &minor, &c, &extra);
if (fields == 3 && TOR_ISALPHA(c)) {
return V_OLD(major, minor, c);
} else if (fields == 2) {