diff options
author | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-01-26 15:08:31 +0000 |
---|---|---|
committer | Simon McVittie <simon.mcvittie@collabora.co.uk> | 2012-01-31 11:01:09 +0000 |
commit | 982b60b0b64704a84cbfa6d0156187622a73c611 (patch) | |
tree | bb1e0838aa1c93eab76b7ee69d4d6ccfabe5410a | |
parent | f7d8ff028c63447e67efe87a5224419ca89bb715 (diff) |
Use g_getenv and g_strtoull instead of getenv and atoi
We don't include stdlib.h (except accidentally, via gcrypt.h), which we
should if we're going to use its functions. In both cases GLib has a
portable version, and our coding style is generally to prefer the GLib
versions of things, so let's use those.
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=43992
-rw-r--r-- | wocky/wocky-tls.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wocky/wocky-tls.c b/wocky/wocky-tls.c index 855b9e6..796ac47 100644 --- a/wocky/wocky-tls.c +++ b/wocky/wocky-tls.c @@ -1433,7 +1433,7 @@ static void wocky_tls_session_init (WockyTLSSession *session) { const char *level; - guint lvl = 0; + guint64 lvl = 0; static gsize initialised; if G_UNLIKELY (g_once_init_enter (&initialised)) @@ -1443,8 +1443,8 @@ wocky_tls_session_init (WockyTLSSession *session) g_once_init_leave (&initialised, 1); } - if ((level = getenv ("WOCKY_TLS_DEBUG_LEVEL")) != NULL) - lvl = atoi (level); + if ((level = g_getenv ("WOCKY_TLS_DEBUG_LEVEL")) != NULL) + lvl = g_ascii_strtoull (level, NULL, 10); tls_debug_level = lvl; gnutls_global_set_log_level (lvl); @@ -1481,7 +1481,7 @@ wocky_tls_session_set_property (GObject *object, guint prop_id, static const char * tls_options (void) { - const char *options = getenv ("WOCKY_GNUTLS_OPTIONS"); + const char *options = g_getenv ("WOCKY_GNUTLS_OPTIONS"); return (options != NULL && *options != '\0') ? options : DEFAULT_TLS_OPTIONS; } |