=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/find/misc.c,v retrieving revision 1.14 retrieving revision 1.15 diff -c -r1.14 -r1.15 *** src/usr.bin/find/misc.c 2015/07/14 16:58:22 1.14 --- src/usr.bin/find/misc.c 2015/07/14 17:18:48 1.15 *************** *** 1,4 **** ! /* $OpenBSD: misc.c,v 1.14 2015/07/14 16:58:22 millert Exp $ */ /*- * Copyright (c) 1990, 1993 --- 1,4 ---- ! /* $OpenBSD: misc.c,v 1.15 2015/07/14 17:18:48 millert Exp $ */ /*- * Copyright (c) 1990, 1993 *************** *** 39,44 **** --- 39,45 ---- #include #include #include + #include #include #include #include *************** *** 60,71 **** for (p = *store; (ch = *orig); ++orig) if (ch == '{' && orig[1] == '}') { while ((p - *store) + plen > len) { char *newstore; newstore = reallocarray(*store, len, 2); if (newstore == NULL) err(1, NULL); ! p = (p - *store) + newstore; *store = newstore; len *= 2; } --- 61,74 ---- for (p = *store; (ch = *orig); ++orig) if (ch == '{' && orig[1] == '}') { while ((p - *store) + plen > len) { + ptrdiff_t p_off; char *newstore; + p_off = (p - *store); newstore = reallocarray(*store, len, 2); if (newstore == NULL) err(1, NULL); ! p = newstore + p_off; *store = newstore; len *= 2; }