GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
strip.c
Go to the documentation of this file.
1 
7 /* db_strip(buf)
8  * char *buf buffer to be worked on
9  *
10  * 'buf' is rewritten in place with leading and trailing white
11  * space removed.
12  */
13 
14 
15 void db_strip(char *buf)
16 {
17  char *a, *b;
18 
19  /* remove leading white space */
20  for (a = b = buf; *a == ' ' || *a == '\t'; a++) ;
21  if (a != b)
22  while ((*b++ = *a++)) ;
23 
24  /* remove trailing white space */
25  for (a = buf; *a; a++) ;
26  if (a != buf) {
27  for (a--; *a == ' ' || *a == '\t'; a--) ;
28  a++;
29  *a = 0;
30  }
31 }
float b
Definition: named_colr.c:8
void db_strip(char *buf)
Definition: strip.c:15
char buf[GNAME_MAX+sizeof(G3D_DIRECTORY)+2]
Definition: g3drange.c:62