mirror of
https://kernel.googlesource.com/pub/scm/network/tftp/tftp-hpa
synced 2025-04-26 01:49:52 +03:00

The source code was a mix of different styles; normalize on NASM style; basically K&R style with 4 space indentation.
20 lines
251 B
C
20 lines
251 B
C
/*
|
|
* xstrdup.c
|
|
*
|
|
* Simple error-checking version of strdup()
|
|
*
|
|
*/
|
|
|
|
#include "config.h"
|
|
|
|
char *xstrdup(const char *s)
|
|
{
|
|
char *p = strdup(s);
|
|
|
|
if (!p) {
|
|
fprintf(stderr, "Out of memory!\n");
|
|
exit(128);
|
|
}
|
|
|
|
return p;
|
|
}
|