mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-11 12:28:27 +00:00
Fix ODBC to clear title each time (bug #3379)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@4851 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -134,6 +134,24 @@ extern int test_for_thread_safety(void);
|
||||
extern const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia);
|
||||
extern int ast_utils_init(void);
|
||||
|
||||
/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
|
||||
|
||||
struct ast_realloca {
|
||||
char *ptr;
|
||||
int alloclen;
|
||||
};
|
||||
|
||||
#define ast_restrdupa(ra, s) \
|
||||
({ \
|
||||
if ((ra)->ptr && strlen(s) + 1 < (ra)->alloclen) { \
|
||||
strcpy((ra)->ptr, s); \
|
||||
} else { \
|
||||
(ra)->ptr = alloca(strlen(s) + 1 - (ra)->alloclen); \
|
||||
if ((ra)->ptr) (ra)->alloclen = strlen(s) + 1; \
|
||||
} \
|
||||
(ra)->ptr; \
|
||||
})
|
||||
|
||||
#ifdef inet_ntoa
|
||||
#undef inet_ntoa
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user