diff options
author | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
---|---|---|
committer | Robin Burchell w00t@inspircd.org <Robin Burchell w00t@inspircd.org@5417fbe8-f217-4b02-8779-1006273d7864> | 2008-09-30 18:45:09 +0000 |
commit | aa806eba53a7ccc715839bd972c9b158f39b6225 (patch) | |
tree | 8e29db334836fbcf4ab869209f34907821f1dacd /src/misc.c | |
parent | c5e113ee056b28ff39232f28faf208163c6c86f0 (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.c | 18 |
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]; |