Replace most uses of assert by ovs_assert.
[sliver-openvswitch.git] / lib / dynamic-string.c
index e7ad73c..bd1cf45 100644 (file)
@@ -16,7 +16,6 @@
 
 #include <config.h>
 #include "dynamic-string.h"
-#include <assert.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
@@ -165,7 +164,7 @@ ds_put_format_valist(struct ds *ds, const char *format, va_list args_)
         needed = vsnprintf(&ds->string[ds->length], available, format, args);
         va_end(args);
 
-        assert(needed < available);
+        ovs_assert(needed < available);
         ds->length += needed;
     }
 }
@@ -311,7 +310,7 @@ ds_cstr(struct ds *ds)
 const char *
 ds_cstr_ro(const struct ds *ds)
 {
-    return ds_cstr((struct ds *) ds);
+    return ds_cstr(CONST_CAST(struct ds *, ds));
 }
 
 /* Returns a null-terminated string representing the current contents of 'ds',