Commit 6535eb3a authored by Dave Cheney's avatar Dave Cheney

cmd/ld: fix valgrind warning in strnput

Fixes #4592.

Thanks to minux for the suggestion.

R=minux.ma, iant
CC=golang-dev
https://golang.org/cl/7017048
parent 90f9beca
......@@ -580,7 +580,7 @@ datblk(int32 addr, int32 size)
void
strnput(char *s, int n)
{
for(; *s && n > 0; s++) {
for(; n > 0 && *s; s++) {
cput(*s);
n--;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment