reindentation

git-svn-id: svn://katsu.triplehelix.org/dgamelaunch/trunk@80 db0b04b0-f4d1-0310-9a6d-de3e77497b0e
This commit is contained in:
Joshua Kwan 2004-01-04 22:49:29 +00:00
parent 1adf4dbb69
commit 4aed9485f4
2 changed files with 40 additions and 39 deletions

View File

@ -1142,8 +1142,8 @@ purge_stale_locks (void)
size_t len; size_t len;
int seconds = 0; int seconds = 0;
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, "..")) if (!strcmp (dent->d_name, ".") || !strcmp (dent->d_name, ".."))
continue; continue;
colon = strchr (dent->d_name, ':'); colon = strchr (dent->d_name, ':');
/* should never happen */ /* should never happen */
@ -1153,11 +1153,11 @@ purge_stale_locks (void)
if (strncmp (dent->d_name, me->username, colon - dent->d_name)) if (strncmp (dent->d_name, me->username, colon - dent->d_name))
continue; continue;
len = strlen(dent->d_name) + ARRAY_SIZE(LOC_INPROGRESSDIR) + 1; len = strlen (dent->d_name) + ARRAY_SIZE (LOC_INPROGRESSDIR) + 1;
fn = malloc (len); fn = malloc (len);
snprintf(fn, len, "%s%s", LOC_INPROGRESSDIR, dent->d_name); snprintf (fn, len, "%s%s", LOC_INPROGRESSDIR, dent->d_name);
if (!(ipfile = fopen (fn, "r"))) if (!(ipfile = fopen (fn, "r")))
graceful_exit (202); graceful_exit (202);
@ -1168,7 +1168,8 @@ purge_stale_locks (void)
clear (); clear ();
drawbanner (1, 1); drawbanner (1, 1);
mvaddstr (3, 1, "There is a stale Nethack process, attempting to recover..."); mvaddstr (3, 1,
"There is a stale Nethack process, attempting to recover...");
refresh (); refresh ();
pid = atoi (buf); pid = atoi (buf);
@ -1193,13 +1194,13 @@ purge_stale_locks (void)
kill (pid, SIGTERM); kill (pid, SIGTERM);
break; break;
} }
else else
{ {
endwin(); endwin ();
fprintf(stderr, "Sorry, no nethack for you now, please " fprintf (stderr, "Sorry, no nethack for you now, please "
"contact the admin.\n"); "contact the admin.\n");
graceful_exit(1); graceful_exit (1);
} }
} }
} }

View File

@ -29,7 +29,7 @@
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = static char *rcsid =
"$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $"; "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -44,33 +44,33 @@ static char *rcsid =
*/ */
size_t size_t
strlcat (dst, src, siz) strlcat (dst, src, siz)
char *dst; char *dst;
const char *src; const char *src;
size_t siz; size_t siz;
{ {
register char *d = dst; register char *d = dst;
register const char *s = src; register const char *s = src;
register size_t n = siz; register size_t n = siz;
size_t dlen; size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */ /* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0') while (n-- != 0 && *d != '\0')
d++; d++;
dlen = d - dst; dlen = d - dst;
n = siz - dlen; n = siz - dlen;
if (n == 0) if (n == 0)
return (dlen + strlen (s)); return (dlen + strlen (s));
while (*s != '\0') while (*s != '\0')
{ {
if (n != 1) if (n != 1)
{ {
*d++ = *s; *d++ = *s;
n--; n--;
} }
s++; s++;
} }
*d = '\0'; *d = '\0';
return (dlen + (s - src)); /* count does not include NUL */ return (dlen + (s - src)); /* count does not include NUL */
} }