comparison src/xs_support.c @ 57:85811bcd049e

Improved, re-written configuration code and lots of minor fixes
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 22 Jun 2003 11:01:03 +0000
parents 6a3ce7260ae1
children 94497283affa
comparison
equal deleted inserted replaced
56:6a3ce7260ae1 57:85811bcd049e
58 58
59 return 0; 59 return 0;
60 } 60 }
61 61
62 62
63 int xs_strpcat(gchar **ppcResult, gint *j, const gchar *pcStr) 63 gint xs_strpcat(gchar *pcResult, gint *j, const gchar *pcStr)
64 { 64 {
65 int iLen; 65 assert(pcResult);
66
67 assert(ppcResult);
68 assert(pcStr); 66 assert(pcStr);
69 assert(j); 67 assert(j);
70 68
71 /* Get length of the pcString to be catted */
72 iLen = strlen(pcStr);
73 (*j) += iLen;
74
75 /* Re-allocate memory for destination */
76 *ppcResult = (gchar *) g_realloc(*ppcResult, strlen(*ppcResult) + iLen + 1);
77 if (*ppcResult == NULL) return -1;
78
79 /* Cat to the destination */ 69 /* Cat to the destination */
80 strcat(*ppcResult, pcStr); 70 strcpy((pcResult+(*j)), pcStr);
71 (*j) += strlen(pcStr);
81 72
82 return 0; 73 return 0;
83 } 74 }
84 75
85 76