Page MenuHomeFreeBSD

D36831.id111251.diff
No OneTemporary

D36831.id111251.diff

diff --git a/usr.bin/rs/rs.c b/usr.bin/rs/rs.c
--- a/usr.bin/rs/rs.c
+++ b/usr.bin/rs/rs.c
@@ -43,6 +43,7 @@
#include <err.h>
#include <ctype.h>
#include <limits.h>
+#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -370,13 +371,15 @@
getptrs(char **sp)
{
char **p;
+ ptrdiff_t offset;
+ offset = sp - elem;
allocsize += allocsize;
p = (char **)realloc(elem, allocsize * sizeof(char *));
if (p == NULL)
err(1, "no memory");
- sp += (p - elem);
+ sp = p + offset;
endelem = (elem = p) + allocsize;
return(sp);
}

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 8:59 PM (20 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14950327
Default Alt Text
D36831.id111251.diff (572 B)

Event Timeline