Skip to contentSkip to conversation

agetty: Change size_t to const size_t to match other function.

PATCH New Marlon Rac Cambasis 1 participant 1 message May 29, 2021 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 agetty: Change size_t to const size_t to match other function.

In xgetdomainname() it is 'const size_t sz', however in xgethostname() it is 'size_t sz'. Add 'const' in xgethostname() to match the other function.

---
 term-utils/agetty.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
term-utils/agetty.c +1 -1
index a48998c16..eb7959d34 100644
@@ -1476,7 +1476,7 @@ static void auto_baud(struct termios *tp)
 static char *xgethostname(void)
 {
 	char *name;
-	size_t sz = get_hostname_max() + 1;
+	const size_t sz = get_hostname_max() + 1;
 
 	name = malloc(sizeof(char) * sz);
 	if (!name)
Signature · 1 line
2.20.1