svn commit: samba r5065 - in trunk/source/lib: .
jra at samba.org
jra at samba.org
Fri Jan 28 21:55:33 GMT 2005
Author: jra
Date: 2005-01-28 21:55:33 +0000 (Fri, 28 Jan 2005)
New Revision: 5065
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=5065
Log:
A couple of small fixes from James Peach @ SGI.
Jeremy.
Modified:
trunk/source/lib/util.c
trunk/source/lib/util_str.c
Changeset:
Modified: trunk/source/lib/util.c
===================================================================
--- trunk/source/lib/util.c 2005-01-28 21:01:58 UTC (rev 5064)
+++ trunk/source/lib/util.c 2005-01-28 21:55:33 UTC (rev 5065)
@@ -1534,6 +1534,11 @@
ZERO_ARRAY(names);
ZERO_ARRAY(namebuf);
+ /* We need to be root so we can open our /proc entry to walk
+ * our stack. It also helps when we want to dump core.
+ */
+ become_root();
+
for (i = 0; i < BACKTRACE_STACK_SIZE; i++) {
names[i] = namebuf + (i * NAMESIZE);
}
Modified: trunk/source/lib/util_str.c
===================================================================
--- trunk/source/lib/util_str.c 2005-01-28 21:01:58 UTC (rev 5064)
+++ trunk/source/lib/util_str.c 2005-01-28 21:55:33 UTC (rev 5065)
@@ -1558,8 +1558,8 @@
size_t strnlen(const char *s, size_t n)
{
- int i;
- for (i=0; s[i] && i<n; i++)
+ size_t i;
+ for (i=0; i<n && s[i] != '\0'; i++)
/* noop */ ;
return i;
}
More information about the samba-cvs
mailing list