removed all traces of <stdio.h>
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 16 Oct 2003 15:07:51 +0000 (15:07 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Thu, 16 Oct 2003 15:07:51 +0000 (15:07 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@181 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/tests/getctx.c

index 577f35c..93909b2 100644 (file)
 
 #include "compat.h"
 #include "vserver.h"
+#include "internal.h"
+#include "src/util.h"
 
-#include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 
 int main(int argc, char *argv[])
 {
-  if (argc==1) printf("%i\n", vc_X_getctx(0));
-  else         printf("%i\n", vc_X_getctx(atoi(argv[1])));
+  char         buf[32];
+  ctx_t                ctx;
+  
+  if (argc==1) ctx = vc_X_getctx(0);
+  else         ctx = vc_X_getctx(atoi(argv[1]));
+
+  utilvserver_int2str(buf, sizeof buf, ctx, 10);
+
+  WRITE_STR(1, buf);
+  WRITE_MSG(1, "\n");
 
   return 0;
 }