Skip to content

Commit

Permalink
apply review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rizsotto committed May 13, 2019
1 parent a3a0f89 commit ea49637
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bear/main.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ def parse_exec_trace(filename):
def byte_to_int(byte):
return struct.unpack_from("=I", byte)[0]

def parse_length(handler, type):
def parse_length(handler, expected_type):
type_bytes = handler.read(3)
if type_bytes != type:
if type_bytes != expected_type:
raise Exception("type not expected")
length_bytes = handler.read(4)
return byte_to_int(length_bytes)
Expand Down
5 changes: 2 additions & 3 deletions libear/ear.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ static char const **string_array_partial_update(char *const envp[], bear_env_t *
static char const **string_array_single_update(char const *envs[], char const *key, char const *value);
static void report_call(char const *const argv[]);
static int write_report(int fd, char const *const argv[]);
static int write_binary_report(int fd, char const *const cmd[], char const *cwd, pid_t pid);
static char const **string_array_from_varargs(char const * arg, va_list *args);
static char const **string_array_copy(char const **in);
static size_t string_array_length(char const *const *in);
Expand Down Expand Up @@ -490,7 +489,7 @@ static int write_binary_string(int fd, const char *const string) {
return 0;
}

static int wirte_binary_string_list(int fd, const char *const *const strings) {
static int write_binary_string_list(int fd, const char *const *const strings) {
// write type
if (-1 == write(fd, "lst", 3)) {
PERROR("write type");
Expand Down Expand Up @@ -525,7 +524,7 @@ static int write_report(int fd, char const *const argv[]) {
}
}
free((void *)cwd);
if (-1 == wirte_binary_string_list(fd, argv)) {
if (-1 == write_binary_string_list(fd, argv)) {
PERROR("cmd writing failed");
return -1;
}
Expand Down

0 comments on commit ea49637

Please sign in to comment.