Project

General

Profile

Revision 8681a37c src/libs/plugins/imexporters/xml/xml.c

View differences:

src/libs/plugins/imexporters/xml/xml.c
33 33
static void handleTransactionDetails(AB_TRANSACTION *t, const char *sDetails);
34 34

  
35 35

  
36
static char *my_strndup(const char *src, size_t n)
37
{
38
  int len;
39

  
40
  len=strlen(src);
41
  if (len<n)
42
    return strdup(src);
43
  else {
44
    char *cpy;
45

  
46
    cpy=(char *) malloc(n+1);
47
    assert(cpy);
48
    memmove(cpy, src, n);
49
    cpy[n]=0;
50
    return cpy;
51
  }
52
}
36 53

  
54
#define strndup my_strndup
37 55

  
38 56
AB_IMEXPORTER *AB_ImExporterXML_new(AB_BANKING *ab)
39 57
{

Also available in: Unified diff