Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Indent the rest of the code (examples, buildtools, doc...) except for examples/SMPI...
[simgrid.git] / buildtools / Cmake / test_prog / prog_vsnprintf.c
index 30f4a9d..26e1db9 100644 (file)
@@ -7,26 +7,30 @@
 #include <stdio.h>
 #include <stdarg.h>
 
-int my_vsnprintf (char *buf, const char *tmpl, ...)
+int my_vsnprintf(char *buf, const char *tmpl, ...)
 {
-    int i;
-    va_list args;
-    va_start (args, tmpl);
-    i = vsnprintf (buf, 2, tmpl, args);
-    va_end (args);
-    return i;
+  int i;
+  va_list args;
+  va_start(args, tmpl);
+  i = vsnprintf(buf, 2, tmpl, args);
+  va_end(args);
+  return i;
 }
 
 int main(void)
 {
-    char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
-    char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
-    int i;
-    i = my_vsnprintf (bufs, "%s", "111");
-    if (strcmp (bufs, "1")) exit (1);
-    if (i != 3) exit (1);
-    i = my_vsnprintf (bufd, "%d", 111);
-    if (strcmp (bufd, "1")) exit (1);
-    if (i != 3) exit (1);
-    exit(0);
+  char bufs[5] = { 'x', 'x', 'x', '\0', '\0' };
+  char bufd[5] = { 'x', 'x', 'x', '\0', '\0' };
+  int i;
+  i = my_vsnprintf(bufs, "%s", "111");
+  if (strcmp(bufs, "1"))
+    exit(1);
+  if (i != 3)
+    exit(1);
+  i = my_vsnprintf(bufd, "%d", 111);
+  if (strcmp(bufd, "1"))
+    exit(1);
+  if (i != 3)
+    exit(1);
+  exit(0);
 }