checkptr.c
来自「汇编源代码大全」· C语言 代码 · 共 38 行
C
38 行
/*--------------------------------------------------------------------*/
/* c h e c k p t r . c */
/* */
/* Support routines for UUPC/extended */
/* */
/* Changes Copyright 1990, 1991 (c) Andrew H. Derbyshire */
/* */
/* History: */
/* 21Nov1991 Break out of lib.c ahd */
/*--------------------------------------------------------------------*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/*--------------------------------------------------------------------*/
/* UUPC/extended include files */
/*--------------------------------------------------------------------*/
#include "lib.h"
/*--------------------------------------------------------------------*/
/* c h e c k p t r */
/* */
/* Verfiy that a pointer is not null */
/*--------------------------------------------------------------------*/
void checkptr(const void *block, const char *file, const int line)
{
if (block == NULL)
{
printmsg(0,"Storage allocation failure; possible cause:\
memory shortage.");
bugout( line, file);
}
} /* checkptr */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?