projects
/
lcr.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix lot of warnings
[lcr.git]
/
callerid.c
diff --git
a/callerid.c
b/callerid.c
index
47b51da
..
b9e59ab
100644
(file)
--- a/
callerid.c
+++ b/
callerid.c
@@
-9,19
+9,23
@@
** **
\*****************************************************************************/
** **
\*****************************************************************************/
-#include "main.h"
+#include <string.h>
+#include <time.h>
+#include "extension.h"
+#include "message.h"
+#include "callerid.h"
/* create caller id from digits by comparing with national and international
* prefixes.
*/
/* create caller id from digits by comparing with national and international
* prefixes.
*/
-c
har *nationalize_callerinfo(char *string, int *ntype, char *national,
char *international)
+c
onst char *nationalize_callerinfo(const char *string, int *ntype, const char *national, const
char *international)
{
{
- if (!strncmp(
options.international, string, strlen(options.
international)))
+ if (!strncmp(
international, string, strlen(
international)))
{
*ntype = INFO_NTYPE_INTERNATIONAL;
return(string+strlen(international));
}
{
*ntype = INFO_NTYPE_INTERNATIONAL;
return(string+strlen(international));
}
- if (!strncmp(
options.national, string, strlen(options.
national)))
+ if (!strncmp(
national, string, strlen(
national)))
{
*ntype = INFO_NTYPE_NATIONAL;
return(string+strlen(national));
{
*ntype = INFO_NTYPE_NATIONAL;
return(string+strlen(national));
@@
-33,21
+37,23
@@
char *nationalize_callerinfo(char *string, int *ntype, char *national, char *int
/* create number (including access codes) from caller id
* prefixes.
*/
/* create number (including access codes) from caller id
* prefixes.
*/
-c
har *numberrize_callerinfo(char *string, int ntype, char *national,
char *international)
+c
onst char *numberrize_callerinfo(const char *string, int ntype, const char *national, const
char *international)
{
static char result[256];
switch(ntype)
{
case INFO_NTYPE_INTERNATIONAL:
{
static char result[256];
switch(ntype)
{
case INFO_NTYPE_INTERNATIONAL:
- UCPY(result, international);
- SCAT(result, string);
+ strcpy(result, international);
+ strncat(result, string, sizeof(result));
+ result[sizeof(result)-1] = '\0';
return(result);
break;
case INFO_NTYPE_NATIONAL:
return(result);
break;
case INFO_NTYPE_NATIONAL:
- UCPY(result, national);
- SCAT(result, string);
+ strcpy(result, national);
+ strncat(result, string, sizeof(result));
+ result[sizeof(result)-1] = '\0';
return(result);
break;
return(result);
break;