summaryrefslogtreecommitdiff
path: root/common/compat.c
blob: 6a4b9140c7adf47a7c9c27ee6c40f07e000ea4af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

#include "usuals.h"
#include "compat.h"

#ifndef HAVE_REALLOCF

void* reallocf(void* ptr, size_t size)
{
	void* ret = realloc(ptr, size);

	if(!ret && size)
		free(ptr);

	return ret;
}

#endif

#ifndef HAVE_STRLWR
char* strlwr(char* s)
{
  char* t = s;
  while(*t)
  {
    *t = tolower(*t);
    t++;
  }
  return s;
}
#endif