Date: Sun, 10 Jan 2010 15:25:46 +0000 (UTC) From: Ed Schouten <ed@FreeBSD.org> To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r202005 - user/ed/utmpx/lib/libulog Message-ID: <201001101525.o0AFPkGg064328@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ed Date: Sun Jan 10 15:25:45 2010 New Revision: 202005 URL: http://svn.freebsd.org/changeset/base/202005 Log: Fix off-by-one. Modified: user/ed/utmpx/lib/libulog/ulog_login.c Modified: user/ed/utmpx/lib/libulog/ulog_login.c ============================================================================== --- user/ed/utmpx/lib/libulog/ulog_login.c Sun Jan 10 15:18:16 2010 (r202004) +++ user/ed/utmpx/lib/libulog/ulog_login.c Sun Jan 10 15:25:45 2010 (r202005) @@ -47,7 +47,7 @@ ulog_genid(struct utmpx *utx, const char * Prepend an 'u' to indicate it was done by libulog. */ utx->ut_id[0] = 'u'; - for (s = strlen(line), d = 1; s > 0 && d <= sizeof utx->ut_id; s--, d++) + for (s = strlen(line), d = 1; s > 0 && d < sizeof utx->ut_id; s--, d++) utx->ut_id[d] = line[s - 1]; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201001101525.o0AFPkGg064328>