summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/command.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ppp/command.c')
-rw-r--r--usr.sbin/ppp/command.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/ppp/command.c b/usr.sbin/ppp/command.c
index 36cd8ed..ae68eec 100644
--- a/usr.sbin/ppp/command.c
+++ b/usr.sbin/ppp/command.c
@@ -263,7 +263,11 @@ IdentCommand(struct cmdargs const *arg)
for (pos = 0, f = arg->argn; f < arg->argc && pos < max; f++) {
n = snprintf(arg->cx->physical->link.lcp.cfg.ident + pos, max - pos,
"%s%s", f == arg->argn ? "" : " ", arg->argv[f]);
- if (n == -1 || (pos += n) >= max)
+ if (n < 0) {
+ arg->cx->physical->link.lcp.cfg.ident[pos] = '\0';
+ break;
+ }
+ if ((pos += n) >= max)
break;
}
OpenPOWER on IntegriCloud