fixes for ubuntu 12.04

fix some compiler complains
This commit is contained in:
Stefani Seibold 2015-10-22 17:32:44 +02:00
parent 376bcb2581
commit 96cd4a6ce8
2 changed files with 7 additions and 3 deletions

View File

@ -246,8 +246,12 @@ char **process_options(int argc, char **argv)
char *output = NULL;
char *cwd = NULL;
if (!sockdef)
asprintf(&sockdef, "/tmp/mtrace%u.sock", getuid());
if (!sockdef) {
if (asprintf(&sockdef, "/tmp/mtrace%u.sock", getuid()) == -1) {
fprintf(stderr, "%s\n", strerror(errno));
exit(1);
}
}
progname = argv[0];

View File

@ -272,7 +272,7 @@ void *mem_scan(struct task *task, struct mt_msg *cmd, void *payload, unsigned lo
}
if (do_peek) {
if (copy_from_proc(task, ARCH_ADDR_T(start), page_buf, sizeof(page_buf)) != sizeof(page_buf)) {
if (copy_from_proc(task, ARCH_ADDR_T(start), page_buf, sizeof(page_buf)) != (int)sizeof(page_buf)) {
fprintf(stderr, "ptrace (%s)\n", strerror(errno));
break;
}