Skip to content
Snippets Groups Projects
Commit 66322bac authored by rswindell's avatar rswindell
Browse files

Created SAFEPRINTF4 macro.

parent 8d42e51b
No related branches found
No related tags found
No related merge requests found
......@@ -197,6 +197,7 @@ typedef struct {
#define SAFEPRINTF(dst,fmt,arg) snprintf(dst,sizeof(dst),fmt,arg), TERMINATE(dst)
#define SAFEPRINTF2(dst,fmt,a1,a2) snprintf(dst,sizeof(dst),fmt,a1,a2), TERMINATE(dst)
#define SAFEPRINTF3(dst,fmt,a1,a2,a3) snprintf(dst,sizeof(dst),fmt,a1,a2,a3), TERMINATE(dst)
#define SAFEPRINTF4(dst,fmt,a1,a2,a3,a4) snprintf(dst,sizeof(dst),fmt,a1,a2,a3,a4), TERMINATE(dst)
/* Replace every occurance of c1 in str with c2, using p as a temporary char pointer */
#define REPLACE_CHARS(str,c1,c2,p) for((p)=(str);*(p);(p)++) if(*(p)==(c1)) *(p)=(c2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment