]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/bootstrap_custom/server/src/module.c
benchmarks: use better bench. bootstrap: Fix slow memory access bug.
[l4.git] / l4 / pkg / bootstrap_custom / server / src / module.c
1 /*
2  * (c) 2008-2009 Frank Mehnert <fm3@os.inf.tu-dresden.de>,
3  *               Torsten Frenzel <frenzel@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  */
10 #include <stdio.h>
11 #include "module.h"
12
13 void
14 print_module_name(const char *name, const char *alt_name)
15 {
16   const char *c1, *c2;
17
18   if (!name)
19     {
20       printf("%s", alt_name);
21       return;
22     }
23
24   c2 = name;
25   while (*c2 != '\0' && *c2 != ' ')
26     c2++;
27   c1 = c2;
28   if (c1 > name)
29     c1--;
30   while (c1 > name && c2-c1 < 56)
31     c1--;
32
33   printf("%.*s", (unsigned)(c2-c1), c1);
34 }