mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
Removed windowsism: now uses fatalbox rather than MessageBox.
[originally from svn r40]
This commit is contained in:
parent
a7dc00c788
commit
24c7f9b058
17
misc.c
17
misc.c
@ -1,4 +1,5 @@
|
|||||||
#include <windows.h>
|
/* $Id: misc.c,v 1.2.2.1 1999/02/19 15:24:15 ben Exp $ */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include "putty.h"
|
#include "putty.h"
|
||||||
@ -24,11 +25,8 @@ void mlog(char *file, int line) {
|
|||||||
|
|
||||||
void *safemalloc(size_t size) {
|
void *safemalloc(size_t size) {
|
||||||
void *p = malloc (size);
|
void *p = malloc (size);
|
||||||
if (!p) {
|
if (!p)
|
||||||
MessageBox(NULL, "Out of memory!", "PuTTY Fatal Error",
|
fatalbox("%s", "Out of memory!");
|
||||||
MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#ifdef MALLOC_LOG
|
#ifdef MALLOC_LOG
|
||||||
if (fp)
|
if (fp)
|
||||||
fprintf(fp, "malloc(%d) returns %p\n", size, p);
|
fprintf(fp, "malloc(%d) returns %p\n", size, p);
|
||||||
@ -42,11 +40,8 @@ void *saferealloc(void *ptr, size_t size) {
|
|||||||
p = malloc (size);
|
p = malloc (size);
|
||||||
else
|
else
|
||||||
p = realloc (ptr, size);
|
p = realloc (ptr, size);
|
||||||
if (!p) {
|
if (!p)
|
||||||
MessageBox(NULL, "Out of memory!", "PuTTY Fatal Error",
|
fatalbox("%s", "Out of memory!");
|
||||||
MB_SYSTEMMODAL | MB_ICONERROR | MB_OK);
|
|
||||||
exit(1);
|
|
||||||
}
|
|
||||||
#ifdef MALLOC_LOG
|
#ifdef MALLOC_LOG
|
||||||
if (fp)
|
if (fp)
|
||||||
fprintf(fp, "realloc(%p,%d) returns %p\n", ptr, size, p);
|
fprintf(fp, "realloc(%p,%d) returns %p\n", ptr, size, p);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user