error_handlers.c

来自「国外一个非常经典的OBD2车辆检测的实例源代码」· C语言 代码 · 共 24 行

C
24
字号
#include <string.h>
#include "globals.h"
#include "error_handlers.h"


void fatal_error(char *msg)
{
   char temp_buf[512];

   if (datafile != NULL)
      unload_datafile(datafile);

   sprintf(temp_buf, "\nERROR: %s", msg);
   strcat(temp_buf, "\n\nPlease contact ScanTool.net via our website at http://www.ScanTool.net/support");
   strcat(temp_buf, "\nInclude the following information:");
   strcat(temp_buf, "\n\t- Exact error message");
   strcat(temp_buf, "\n\t- CPU type/speed, i.e. \"Pentium 100Mhz\"");
   strcat(temp_buf, "\n\t- OS, i.e. \"Windows 95\"");
   strcat(temp_buf, "\n\t- Total amount of RAM installed, i.e. \"4Mb\"\n\n");
   allegro_message(temp_buf);
   
   exit(EXIT_FAILURE);
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?