Remove unneeded test and extra enforcement of 0 terminated buffer

This commit is contained in:
Dave Davenport 2023-03-27 11:52:27 +02:00
parent ebae594c08
commit 3446e88cb8
3 changed files with 4 additions and 3 deletions

View File

@ -8,5 +8,5 @@ pushd "${MESON_BUILD_ROOT}"
for a in $@
do
go-md2man -in $a -out ${a%.markdown}
go-md2man -in "$a" -out ${a%.markdown}
done

View File

@ -582,8 +582,9 @@ int create_pid_file(const char *pidfile, gboolean kill_running) {
char buffer[64] = {
0,
};
ssize_t l = read(fd, &buffer, 64);
ssize_t l = read(fd, &buffer, 63);
if (l > 1) {
buffer[l] = 0;
pid_t pid = g_ascii_strtoll(buffer, NULL, 0);
kill(pid, SIGTERM);
while (1) {

View File

@ -1074,7 +1074,7 @@ int main(int argc, char *argv[]) {
*/
const char **theme_str = find_arg_strv("-theme-str");
if (theme_str) {
for (int index = 0; theme_str && theme_str[index]; index++) {
for (int index = 0; theme_str[index]; index++) {
if (rofi_theme_parse_string(theme_str[index])) {
g_warning("Failed to parse -theme-str option: \"%s\"",
theme_str[index]);