Fix some minor issues

This commit is contained in:
Justine Tunney 2023-04-18 05:02:45 -07:00
parent d484e1dbd4
commit a8ff220654
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
4 changed files with 5 additions and 4 deletions

View file

@ -977,13 +977,13 @@ static privileged void OnSigSys(int sig, siginfo_t *si, void *vctx) {
if (HasSyscall(kPledge + i, si->si_syscall)) {
Log("error: pledge ", kPledge[i].name, " for ",
GetSyscallName(si->si_syscall), " (ord=", ord, " rip=", rip, ")\n",
0);
NULL);
found = true;
}
}
if (!found) {
Log("error: bad syscall (", GetSyscallName(si->si_syscall), " ord=", ord,
" rip=", rip, ")\n", 0);
" rip=", rip, ")\n", NULL);
}
switch (mode & PLEDGE_PENALTY_MASK) {
case PLEDGE_PENALTY_KILL_PROCESS:

View file

@ -1,5 +1,6 @@
#ifndef COSMOPOLITAN_LIBC_ISYSTEM_STRINGS_H_
#define COSMOPOLITAN_LIBC_ISYSTEM_STRINGS_H_
#include "libc/nexgen32e/ffs.h"
#include "libc/str/locale.h"
#include "libc/str/str.h"

View file

@ -30,7 +30,7 @@ char *xstrndup(const char *, size_t) paramsnonnull()
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
char *xstrcat(const char *, ...) paramsnonnull((1)) nullterminated()
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
#define xstrcat(...) (xstrcat)(__VA_ARGS__, 0)
#define xstrcat(...) (xstrcat)(__VA_ARGS__, NULL)
char *xstrmul(const char *, size_t) paramsnonnull((1))
returnspointerwithnoaliases dontthrow nocallback dontdiscard returnsnonnull;
char *xinet_ntop(int, const void *) paramsnonnull()

View file

@ -43,6 +43,6 @@ char *xjoinpaths(const char *path, const char *other) {
} else if (_endswith(path, "/")) {
return xstrcat(path, other);
} else {
return xstrcat(path, '/', other);
return xstrcat(path, (uintptr_t)'/', other);
}
}