Skip to content

Commit

Permalink
Merge pull request #43 from rofl0r/fixit
Browse files Browse the repository at this point in the history
PSPSH: Fix build error, UB, and a warning.
  • Loading branch information
diamant3 authored Mar 5, 2024
2 parents 1405de0 + e3e4a14 commit b9156ad
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions pspsh/pspsh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*
*/
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/select.h>
Expand Down Expand Up @@ -434,7 +435,7 @@ int strlen_cmd(int argc, char **argv)
{
char val[32];

snprintf(val, sizeof(val), "%d", strlen(argv[0]));
snprintf(val, sizeof(val), "%zu", strlen(argv[0]));
setenv("?", val, 1);

return 0;
Expand Down Expand Up @@ -688,14 +689,12 @@ char *command_gen(const char *text, int state)
{
static int cmdno;
static int driveno;
static int locals;
static int len;

if(state == 0)
{
cmdno = 0;
driveno = 0;
locals = 0;
len = strlen(text);
}

Expand Down

0 comments on commit b9156ad

Please sign in to comment.