Skip to content
This repository was archived by the owner on Oct 1, 2022. It is now read-only.

Commit b0dc99b

Browse files
committed
Improved test.c reliability.
This is done by discarding non-printable readings until we get a char, instead of skipping that position (address). The original behavior causes everything after that be empty as well, presumably because of a system lag spike at that moment. This looks fine to me for PoC demo purposes.
1 parent 6148022 commit b0dc99b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test.c

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#include "libkdump.h"
2+
#include <ctype.h>
23
#include <stdio.h>
34
#include <stdlib.h>
45
#include <string.h>
@@ -31,6 +32,8 @@ int main(int argc, char *argv[]) {
3132
printf(" Got: \x1b[33;1m");
3233
while (index < strlen(test)) {
3334
int value = libkdump_read((size_t)(test + index));
35+
if (!isprint(value))
36+
continue;
3437
printf("%c", value);
3538
fflush(stdout);
3639
index++;

0 commit comments

Comments
 (0)