Codebase list nbtscan-unixwiz / 4bb555f0-764e-4896-86ad-0d5a571e30c2/main errors.c
4bb555f0-764e-4896-86ad-0d5a571e30c2/main

Tree @4bb555f0-764e-4896-86ad-0d5a571e30c2/main (Download .tar.gz)

errors.c @4bb555f0-764e-4896-86ad-0d5a571e30c2/mainraw · history · blame

/*
 * $Id: //devel/tools/main/nbtscan/errors.c#1 $
 *
 * written by :	Stephen J. Friedl
 *		Software Consultant
 *		[email protected]
 *
 *	When printing error messages, we must often do so via the UNIX
 *	errno and via the Win32 GetLastError() method. This unifies the
 *	two.
 */
#include "nbtscan_common.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "nbtdefs.h"

const char *unix_errorstr(int error_num)
{
	return strerror(error_num);
}

#ifdef _WIN32
const char *win32_errorstr(DWORD error_num)
{
static char errorbuf[20];

	sprintf(errorbuf, "#%ld", error_num);

	return errorbuf;
}
#endif