1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
2 *
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
5 */
6
7 #include <argz.h>
8 #include <stddef.h>
9 #include <sys/types.h>
10
11 void
argz_stringify(char * argz,size_t argz_len,int sep)12 argz_stringify (char *argz,
13 size_t argz_len,
14 int sep)
15 {
16 size_t i;
17
18 /* len includes trailing \0, which we don't want to replace. */
19 if (argz_len > 1)
20 for (i = 0; i < argz_len - 1; i++)
21 {
22 if (argz[i] == '\0')
23 argz[i] = (char) sep;
24 }
25 }
26