summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTheron <tspiegl@gmail.com>2020-06-26 23:43:45 -0500
committerTheron <tspiegl@gmail.com>2020-06-26 23:43:45 -0500
commit1f21c491f0116bbcc5b41e49eb23331e3a1477f9 (patch)
tree6784db03c51b5332b4fb8ad20d73798addbfae3a
parent678a340d5b1e1adb449ab935a698155ed654414d (diff)
read error fixed?
-rw-r--r--src/attach.c1
-rw-r--r--src/utilities.c4
-rw-r--r--src/whatfiles.h2
-rw-r--r--whatfiles.geany6
4 files changed, 7 insertions, 6 deletions
diff --git a/src/attach.c b/src/attach.c
index b40739d..5a86994 100644
--- a/src/attach.c
+++ b/src/attach.c
@@ -18,6 +18,7 @@ void read_file(struct String *str, size_t size, FILE *file)
{
char c;
for (size_t read = 0; read < size && (c = fgetc(file)) != EOF; read++) {
+ if (c == 255) break; // necessary on Raspbian, not sure why fgetc doesn't seem to return EOF == 0xffffffff for /proc/[PID]/comm
append_char(c, str);
}
}
diff --git a/src/utilities.c b/src/utilities.c
index 6b086ad..c8b08b9 100644
--- a/src/utilities.c
+++ b/src/utilities.c
@@ -12,7 +12,7 @@ char *FLAGS = "ado:p:s";
void build_output(
char *mode,
char *syscall_name,
- unsigned long long reg,
+ unsigned long reg,
pid_t pid,
struct String *filename,
struct String *result,
@@ -25,7 +25,7 @@ void build_output(
char mode_str[MODE_LEN] = {0};
// grab detected mode or the raw number
- *mode ? sprintf(mode_str, "%5s", mode) : sprintf(mode_str, "0x%llX", reg);
+ *mode ? sprintf(mode_str, "%5s", mode) : sprintf(mode_str, "0x%lX", reg);
append_str("mode: ", strlen("mode: "), result);
append_str(mode_str, strlen(mode_str), result);
diff --git a/src/whatfiles.h b/src/whatfiles.h
index 3739ead..4561c11 100644
--- a/src/whatfiles.h
+++ b/src/whatfiles.h
@@ -37,7 +37,7 @@ void check_ptrace_event(pid_t current_pid, int proc_status, HashMap map);
void build_output(
char *mode,
char *syscall_name,
- unsigned long long reg,
+ unsigned long reg,
pid_t pid,
struct String *filename,
struct String *result,
diff --git a/whatfiles.geany b/whatfiles.geany
index 378c728..6ae4ba0 100644
--- a/whatfiles.geany
+++ b/whatfiles.geany
@@ -28,7 +28,7 @@ long_line_behaviour=1
long_line_column=72
[files]
-current_page=7
+current_page=8
FILE_NAME_0=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Farmv7l%2Fregisters.c;0;4
FILE_NAME_1=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fattach.c;0;4
FILE_NAME_2=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fhashmap.c;0;4
@@ -36,8 +36,8 @@ FILE_NAME_3=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fhashmap.h;0;4
FILE_NAME_4=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fstrings.c;0;4
FILE_NAME_5=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fstrings.h;0;4
FILE_NAME_6=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Futilities.c;0;4
-FILE_NAME_7=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fwhatfiles.c;0;4
-FILE_NAME_8=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fwhatfiles.h;0;4
+FILE_NAME_7=166;C;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fwhatfiles.c;0;4
+FILE_NAME_8=1468;C++;0;EUTF-8;0;1;0;%2Fhome%2Fpi%2Fwhatfiles%2Fsrc%2Fwhatfiles.h;0;4
FILE_NAME_9=0;C++;0;EUTF-8;1;1;0;%2Fusr%2Finclude%2Farm-linux-gnueabihf%2Fasm%2Fptrace.h;0;4
FILE_NAME_10=0;C++;0;EUTF-8;0;1;0;%2Fusr%2Finclude%2Farm-linux-gnueabihf%2Fsys%2Fptrace.h;0;2
FILE_NAME_11=0;C++;0;EUTF-8;1;1;0;%2Fusr%2Finclude%2Flinux%2Fptrace.h;0;4