svn commit: r202005 - user/ed/utmpx/lib/libulog
Ed Schouten
ed at FreeBSD.org
Sun Jan 10 15:25:46 UTC 2010
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];
}
More information about the svn-src-user
mailing list