Add checks to "r_file_mkstemp" calls

This commit is contained in:
jvoisin 2014-04-27 19:42:36 +02:00 committed by pancake
parent 8d24df4bd2
commit 76965f8d77
2 changed files with 10 additions and 0 deletions

View File

@ -17,7 +17,12 @@ static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
int len = 0;
ifd = r_file_mkstemp ("r_as", &ipath);
if (ifd == -1)
return -1;
ofd = r_file_mkstemp ("r_as", &opath);
if (ofd == -1)
return -1;
syntaxstr = ".intel_syntax noprefix\n"; // if intel syntax
len = snprintf (asm_buf, sizeof (asm_buf),

View File

@ -16,7 +16,12 @@ static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
}
ifd = r_file_mkstemp ("r_nasm", &ipath);
if (ifd == -1)
return -1;
ofd = r_file_mkstemp ("r_nasm", &opath);
if (ofd == -1)
return -1;
len = snprintf (asm_buf, sizeof (asm_buf),
"BITS %i\nORG 0x%"PFMT64x"\n%s", a->bits, a->pc, buf);