/* ---------------------------------------------------------------- */
/* ---------------------------------------------------------------- */

#include <extUtil.h>

               
/* liest einen string bis ' ' oder '\n'; uebergibt Anzahl gelesene Zeichen */
/* uebergibt wordlaenge */
int sword( unsigned char *string, unsigned char *word)
{
  int i,n, flag;

    i=n=0;
    while (string[i] == ' ') i++;
    flag = sscanf(string, "%s", word);
    if ((flag <= 0)||(flag == (unsigned char)EOF )) { return(-1); }

    while (word[n] != (unsigned char)NULL)
      n++;
    return(n);

}


