From 1f5267050e60f0902596810d97c16a4f5d5304c4 Mon Sep 17 00:00:00 2001
From: Lubomir Rintel <lkundrak@v3.sk>
Date: Wed, 2 Nov 2016 17:58:15 +0100
Subject: [PATCH 3/3] 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 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/shell/hostname-helper.c b/shell/hostname-helper.c
index 1a063b5cd..df596975e 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;
}
--
2.12.2