]> arthur.barton.de Git - ngircd.git/blobdiff - src/ngircd/class.c
Fix two K&R C portability issues
[ngircd.git] / src / ngircd / class.c
index 156f943ef9a318269edb487ccef5c6168af11487..d08f4c565001062d6f5e18b515644f9634c56769 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -50,11 +50,13 @@ Class_Exit(void)
 GLOBAL bool
 Class_GetMemberReason(const int Class, CLIENT *Client, char *reason, size_t len)
 {
-       char str[COMMAND_LEN] = "listed";
+       char str[COMMAND_LEN];
 
        assert(Class < CLASS_COUNT);
        assert(Client != NULL);
 
+       strlcpy(str, "listed", sizeof(str));
+
        if (!Lists_CheckReason(&My_Classes[Class], Client, str, sizeof(str)))
                return false;
 
@@ -104,7 +106,7 @@ Class_AddMask(const int Class, const char *Pattern, time_t ValidUntil,
        char mask[MASK_LEN];
 
        assert(Class < CLASS_COUNT);
-       assert(Mask != NULL);
+       assert(Pattern != NULL);
        assert(Reason != NULL);
 
        Lists_MakeMask(Pattern, mask, sizeof(mask));
@@ -118,7 +120,7 @@ Class_DeleteMask(const int Class, const char *Pattern)
        char mask[MASK_LEN];
 
        assert(Class < CLASS_COUNT);
-       assert(Mask != NULL);
+       assert(Pattern != NULL);
 
        Lists_MakeMask(Pattern, mask, sizeof(mask));
        Lists_Del(&My_Classes[Class], mask);