summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorerin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-02-13 03:48:28 +0000
committererin_yueh <erin_yueh@99fdad57-331a-0410-800a-d7fa5415bdb3>2008-02-13 03:48:28 +0000
commitbf667e7e9c45b0b0c3787c1023c3b0f6de284cd8 (patch)
tree24247ed5e688cce25b01144a04ceeb1f98dfdea4 /include
parentfb0265f553ca0efe8aac0f10de480bffeff1a33d (diff)
gsmd: add strlcpy, strlcat functions (Paulius Zaleckas)
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4060 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'include')
-rw-r--r--include/gsmd/extrsp.h4
-rw-r--r--include/gsmd/gsmd.h1
-rw-r--r--include/gsmd/strl.h12
3 files changed, 16 insertions, 1 deletions
diff --git a/include/gsmd/extrsp.h b/include/gsmd/extrsp.h
index 1f6e6a5..f7c1430 100644
--- a/include/gsmd/extrsp.h
+++ b/include/gsmd/extrsp.h
@@ -7,6 +7,8 @@
/* how many individual sub-ranges can one range contain */
#define GSM_EXTRSP_MAX_RANGES 16
+/* how many character we are going to store in string buffer */
+#define GSM_EXTRSP_MAX_STRBUF 64
struct gsm_extrsp_range_item {
int min;
@@ -28,7 +30,7 @@ struct gsm_extrsp_tok {
struct gsm_extrsp_range_item item[GSM_EXTRSP_MAX_RANGES];
int num_items;
} range;
- char string[64];
+ char string[GSM_EXTRSP_MAX_STRBUF];
int numeric;
} u;
};
diff --git a/include/gsmd/gsmd.h b/include/gsmd/gsmd.h
index 585d78d..0521dd5 100644
--- a/include/gsmd/gsmd.h
+++ b/include/gsmd/gsmd.h
@@ -12,6 +12,7 @@
#include <gsmd/vendorplugin.h>
#include <gsmd/select.h>
#include <gsmd/state.h>
+#include <gsmd/strl.h>
void *gsmd_tallocs;
diff --git a/include/gsmd/strl.h b/include/gsmd/strl.h
new file mode 100644
index 0000000..de96ab4
--- /dev/null
+++ b/include/gsmd/strl.h
@@ -0,0 +1,12 @@
+#ifndef __GSMD_STRL_H
+#define __GSMD_STRL_H
+
+#ifdef __GSMD__
+
+/* safe strcpy and strcat versions */
+extern size_t strlcpy(char *dest, const char *src, size_t size);
+extern size_t strlcat(char *dest, const char *src, size_t count);
+
+#endif /* __GSMD__ */
+
+#endif
personal git repositories of Harald Welte. Your mileage may vary