use g_strndup instead of strndup
[uzbl-mobile] / uzbl.c
diff --git a/uzbl.c b/uzbl.c
index afcdb6b..0835f51 100644 (file)
--- a/uzbl.c
+++ b/uzbl.c
@@ -31,7 +31,6 @@
 
 
 #define LENGTH(x) (sizeof x / sizeof x[0])
-#define MAX_BINDINGS 256
 #define _POSIX_SOURCE
 
 #include <gtk/gtk.h>
@@ -91,7 +90,7 @@ typedef const struct {
     enum ptr_type type;
     int dump;
     int writeable;
-    void (*func)(void);
+    /*@null@*/ void (*func)(void);
 } uzbl_cmdprop;
 
 /* abbreviations to help keep the table's width humane */
@@ -181,7 +180,7 @@ const struct {
 
 
 const struct {
-    char *key;
+    /*@null@*/ char *key;
     guint mask;
 } modkeys[] = {
     { "SHIFT",   GDK_SHIFT_MASK   }, // shift
@@ -230,6 +229,7 @@ get_exp_type(const gchar *s) {
     else
         return EXP_SIMPLE_VAR;
 
+    /*@notreached@*/
 return EXP_ERR;
 }
 
@@ -289,9 +289,7 @@ expand(const char *s, guint recurse) {
                 }
                 assert(vend);
 
-                ret = strndup(s, vend-s);
-                if(!ret)
-                        abort();
+                ret = g_strndup(s, vend-s);
 
                 if(etype == EXP_SIMPLE_VAR ||
                    etype == EXP_BRACED_VAR) {