about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2014-03-16 20:07:08 +0100
committerAlexander Barton <alex@barton.de>2014-03-16 20:07:08 +0100
commita4ed90ba9af1dce4df3f57f6a7c84097000c7256 (patch)
tree8105fd0c8dedffd5d194201783d770be253efcd8 /src
parentaf9161a9bc32817c44fe6f743b402d554e60ddf2 (diff)
downloadngircd-a4ed90ba9af1dce4df3f57f6a7c84097000c7256.tar.gz
ngircd-a4ed90ba9af1dce4df3f57f6a7c84097000c7256.zip
Fix two K&R C portability issues
Fix the following two errors emitted by the Apple K&R C compiler
on Apple A/UX:

"./class.c", line 47: no automatic aggregate initialization
"./class.c", line 47: illegal lhs of assignment operator

"./conf.c", line 1052: syntax error

Tested on A/UX 3.1.1.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/class.c6
-rw-r--r--src/ngircd/conf.c10
2 files changed, 11 insertions, 5 deletions
diff --git a/src/ngircd/class.c b/src/ngircd/class.c
index b2b1aa35..d08f4c56 100644
--- a/src/ngircd/class.c
+++ b/src/ngircd/class.c
@@ -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;
 
diff --git a/src/ngircd/conf.c b/src/ngircd/conf.c
index 34abbad1..c4b219f8 100644
--- a/src/ngircd/conf.c
+++ b/src/ngircd/conf.c
@@ -1,6 +1,6 @@
 /*
  * ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2013 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
@@ -1053,9 +1053,13 @@ Read_Config(bool TestOnly, bool IsStarting)
 }
 
 /**
- * ...
+ * Read in and handle a configuration file.
+ *
+ * @param File Name of the configuration file.
+ * @param fd File descriptor already opened for reading.
  */
-static void Read_Config_File(const char *File, FILE *fd)
+static void
+Read_Config_File(const char *File, FILE *fd)
 {
 	char section[LINE_LEN], str[LINE_LEN], *var, *arg, *ptr;
 	int i, line = 0;