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;
int seconds = 0;
if (!strcmp(dent->d_name, ".") || !strcmp(dent->d_name, ".."))
continue;
if (!strcmp (dent->d_name, ".") || !strcmp (dent->d_name, ".."))
continue;
colon = strchr (dent->d_name, ':');
/* should never happen */
@ -1153,11 +1153,11 @@ purge_stale_locks (void)
if (strncmp (dent->d_name, me->username, colon - dent->d_name))
continue;
len = strlen(dent->d_name) + ARRAY_SIZE(LOC_INPROGRESSDIR) + 1;
len = strlen (dent->d_name) + ARRAY_SIZE (LOC_INPROGRESSDIR) + 1;
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")))
graceful_exit (202);
@ -1168,7 +1168,8 @@ purge_stale_locks (void)
clear ();
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 ();
pid = atoi (buf);
@ -1193,13 +1194,13 @@ purge_stale_locks (void)
kill (pid, SIGTERM);
break;
}
else
{
endwin();
fprintf(stderr, "Sorry, no nethack for you now, please "
"contact the admin.\n");
graceful_exit(1);
}
else
{
endwin ();
fprintf (stderr, "Sorry, no nethack for you now, please "
"contact the admin.\n");
graceful_exit (1);
}
}
}

View File

@ -29,7 +29,7 @@
#if defined(LIBC_SCCS) && !defined(lint)
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 */
#include <sys/types.h>
@ -44,33 +44,33 @@ static char *rcsid =
*/
size_t
strlcat (dst, src, siz)
char *dst;
const char *src;
size_t siz;
char *dst;
const char *src;
size_t siz;
{
register char *d = dst;
register const char *s = src;
register size_t n = siz;
size_t dlen;
register char *d = dst;
register const char *s = src;
register size_t n = siz;
size_t dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
/* Find the end of dst and adjust bytes left but don't go past end */
while (n-- != 0 && *d != '\0')
d++;
dlen = d - dst;
n = siz - dlen;
if (n == 0)
return (dlen + strlen (s));
while (*s != '\0')
{
if (n != 1)
{
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
if (n == 0)
return (dlen + strlen (s));
while (*s != '\0')
{
if (n != 1)
{
*d++ = *s;
n--;
}
s++;
}
*d = '\0';
return (dlen + (s - src)); /* count does not include NUL */
return (dlen + (s - src)); /* count does not include NUL */
}