Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix errors identified with cppcheck. #20

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions eval.c
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ static char *internal_getval(char *token)

/* grab the line as an argument */
blen = bp->b_dotp->l_used - bp->b_doto;
if (blen > NSTRING)
blen = NSTRING;
if (blen >= NSTRING)
blen = NSTRING - 1;
strncpy(buf, bp->b_dotp->l_text + bp->b_doto, blen);
buf[blen] = 0;

Expand Down
2 changes: 1 addition & 1 deletion random.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int getccol(int bflg)
col |= tabmask;
else if (c < 0x20 || c == 0x7F)
++col;
else if (c >= 0xc0 && c <= 0xa0)
jbatista marked this conversation as resolved.
Show resolved Hide resolved
else if (c >= 0x80 && c <= 0xa0)
col += 2;
++col;
}
Expand Down