[gnome-control-center] hostname-helper: use SSID_MAX_LEN



commit da4a591b4d9623853c21f24a45a00761ec4749bd
Author: Lubomir Rintel <lkundrak v3 sk>
Date:   Wed Nov 2 17:58:15 2016 +0100

    hostname-helper: use SSID_MAX_LEN
    
    It looks a bit weird to define it and still use the numeric literal.

 shell/hostname-helper.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/shell/hostname-helper.c b/shell/hostname-helper.c
index e453f01..b09d93f 100644
--- a/shell/hostname-helper.c
+++ b/shell/hostname-helper.c
@@ -187,7 +187,7 @@ pretty_hostname_to_ssid (const char *pretty)
        if (pretty == NULL) {
                /* translators: This is the default hotspot name, need to be less than 32-bytes */
                ret = g_strdup (C_("hotspot", "Hotspot"));
-               g_assert (strlen (ret) <= 32);
+               g_assert (strlen (ret) <= SSID_MAX_LEN);
                return ret;
        }
 
@@ -199,11 +199,11 @@ pretty_hostname_to_ssid (const char *pretty)
                if (p == prev)
                        break;
 
-               if (p - pretty > 32) {
+               if (p - pretty > SSID_MAX_LEN) {
                        ret = g_strndup (pretty, prev - pretty);
                        break;
                }
-               if (p - pretty == 32) {
+               if (p - pretty == SSID_MAX_LEN) {
                        ret = g_strndup (pretty, p - pretty);
                        break;
                }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]