Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Some more xbt_error_t eradication; change mismatch_error to not_found_error where...
[simgrid.git] / src / xbt / snprintf.c
index b6f7b75..afdc358 100644 (file)
@@ -417,6 +417,12 @@ static char credits[] = "\n\
 @(#)snprintf.c, v2.2: Copyright 1999, Mark Martinec. Frontier Artistic License applies.\n\
 @(#)snprintf.c, v2.2: http://www.ijs.si/software/snprintf/\n";
 
+static void __foo__(void) 
+{
+   printf("%s",credits);
+   __foo__();
+}
+
 #if defined(NEED_ASPRINTF)
 int asprintf(char **ptr, const char *fmt, /*args*/ ...) {
   va_list ap;
@@ -1026,3 +1032,17 @@ int portable_vsnprintf(char *str, size_t str_m, const char *fmt, va_list ap) {
   return (int) str_l;
 }
 #endif
+
+
+/* FIXME: better place */
+#include "xbt/sysdep.h"
+
+char *bprintf(const char*fmt, ...) {
+  va_list ap;
+  char *res;
+  
+  va_start(ap, fmt);
+  vasprintf(&res,fmt,ap);
+  va_end(ap);
+  return res;
+}