]> diplodocus.org Git - nmh/blob - sbr/copyip.c
Fix invalid pointer arithmetic.
[nmh] / sbr / copyip.c
1 /* copyip.c -- copy a string array and return pointer to end
2 *
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
6 */
7
8 #include <h/mh.h>
9
10
11 char **
12 copyip (char **p, char **q, int len_q)
13 {
14 while (*p && --len_q > 0)
15 *q++ = *p++;
16
17 *q = NULL;
18
19 return q;
20 }