summaryrefslogtreecommitdiff
path: root/src/misc.c
diff options
context:
space:
mode:
authorRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
committerRobin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864>2008-09-30 18:45:09 +0000
commitaa806eba53a7ccc715839bd972c9b158f39b6225 (patch)
tree8e29db334836fbcf4ab869209f34907821f1dacd /src/misc.c
parentc5e113ee056b28ff39232f28faf208163c6c86f0 (diff)
Constify a lot of the API. Core now "builds".
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@1182 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/misc.c')
-rw-r--r--src/misc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/misc.c b/src/misc.c
index f63e30b65..24db06728 100644
--- a/src/misc.c
+++ b/src/misc.c
@@ -178,7 +178,23 @@ char *strnrepl(char *s, int32 size, const char *old, const char *newstr)
* @param argv Array
* @return string of the merged array
*/
-char *merge_args(int argc, char **argv)
+const char *merge_args(int argc, const char **argv)
+{
+ int i;
+ static char s[4096];
+ char *t;
+
+ t = s;
+ for (i = 0; i < argc; i++)
+ t += snprintf(t, sizeof(s) - (t - s), "%s%s", *argv++,
+ (i < argc - 1) ? " " : "");
+ return s;
+}
+
+/*
+ * XXX: temporary "safe" version to avoid casting, it's still ugly.
+ */
+const char *merge_args(int argc, char **argv)
{
int i;
static char s[4096];