Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F103279508
D36832.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
762 B
Referenced Files
None
Subscribers
None
D36832.diff
View Options
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
@@ -114,10 +114,11 @@
static void
getfile(void)
{
- char *p;
+ char *p, *sp;
char *endp;
char **ep;
int c;
+ int len;
int multisep = (flags & ONEISEPONLY ? 0 : 1);
int nullpad = flags & NULLPAD;
char **padto;
@@ -159,11 +160,13 @@
*ep = blank;
else /* store column entry */
*ep = p;
+ sp = p;
while (p < endp && *p != isep)
p++; /* find end of entry */
*p = '\0'; /* mark end of entry */
- if (maxlen < p - *ep) /* update maxlen */
- maxlen = p - *ep;
+ len = p - sp;
+ if (maxlen < len) /* update maxlen */
+ maxlen = len;
INCR(ep); /* prepare for next entry */
}
irows++; /* update row count */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 12:19 AM (19 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14811834
Default Alt Text
D36832.diff (762 B)
Attached To
Mode
D36832: rs: Fix some pointer arith UB.
Attached
Detach File
Event Timeline
Log In to Comment