Skip to content

Commit

Permalink
Merge branch 'ms/correct-formating-in-exit' into maint
Browse files Browse the repository at this point in the history
* ms/correct-formating-in-exit:
  Correct formating in exit error messages

OTP-10148
  • Loading branch information
proxyles committed Jul 18, 2012
2 parents d946588 + 408e776 commit f82a553
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion erts/emulator/drivers/common/efile_drv.c
Expand Up @@ -522,7 +522,7 @@ static void *ef_safe_alloc(Uint s)
static void *ef_safe_realloc(void *op, Uint s)
{
void *p = EF_REALLOC(op, s);
if (!p) erl_exit(1, "efile drv: Can't reallocate %d bytes of memory\n", s);
if (!p) erl_exit(1, "efile drv: Can't reallocate %lu bytes of memory\n", (unsigned long)s);
return p;
}

Expand Down
8 changes: 4 additions & 4 deletions erts/emulator/drivers/unix/unix_efile.c
Expand Up @@ -107,8 +107,8 @@ static void *ef_safe_alloc(Uint s)
{
void *p = EF_ALLOC(s);
if (!p) erl_exit(1,
"unix efile drv: Can't allocate %d bytes of memory\n",
s);
"unix efile drv: Can't allocate %lu bytes of memory\n",
(unsigned long)s);
return p;
}

Expand All @@ -118,8 +118,8 @@ static void *ef_safe_realloc(void *op, Uint s)
{
void *p = EF_REALLOC(op, s);
if (!p) erl_exit(1,
"unix efile drv: Can't reallocate %d bytes of memory\n",
s);
"unix efile drv: Can't reallocate %lu bytes of memory\n",
(unsigned long)s);
return p;
}

Expand Down
4 changes: 2 additions & 2 deletions lib/kernel/examples/uds_dist/c_src/uds_drv.c
Expand Up @@ -967,7 +967,7 @@ static void *my_malloc(size_t size)
void *ptr;

if ((ptr = driver_alloc(size)) == NULL) {
erl_exit(1,"Could not allocate %d bytes of memory",(int) size);
erl_exit(1,"Could not allocate %lu bytes of memory",(unsigned long) size);
}
return ptr;
}
Expand All @@ -977,7 +977,7 @@ static void *my_realloc(void *ptr, size_t size)
void erl_exit(int, char *, ...);
void *nptr;
if ((nptr = driver_realloc(ptr, size)) == NULL) {
erl_exit(1,"Could not reallocate %d bytes of memory",(int) size);
erl_exit(1,"Could not reallocate %lu bytes of memory",(unsigned long) size);
}
return nptr;
}
Expand Down
8 changes: 4 additions & 4 deletions lib/runtime_tools/c_src/trace_ip_drv.c
Expand Up @@ -590,8 +590,8 @@ static void *my_alloc(size_t size)
void *ret;
if ((ret = driver_alloc(size)) == NULL) {
/* May or may not work... */
fprintf(stderr, "Could not allocate %d bytes of memory in %s.",
(int) size, __FILE__);
fprintf(stderr, "Could not allocate %lu bytes of memory in %s.",
(unsigned long) size, __FILE__);
exit(1);
}
return ret;
Expand All @@ -605,8 +605,8 @@ static ErlDrvBinary *my_alloc_binary(int size)
ErlDrvBinary *ret;
if ((ret = driver_alloc_binary(size)) == NULL) {
/* May or may not work... */
fprintf(stderr, "Could not allocate a binary of %d bytes in %s.",
(int) size, __FILE__);
fprintf(stderr, "Could not allocate a binary of %lu bytes in %s.",
(unsigned long) size, __FILE__);
exit(1);
}
return ret;
Expand Down

0 comments on commit f82a553

Please sign in to comment.