Logo Search packages:      
Sourcecode: vcdimager version File versions

const char* vcdinfo_strip_trail ( const char  str[],
size_t  n 
)

Change trailing blanks in str to nulls. Str has a maximum size of n characters.

Change trailing blanks in str to nulls. Str has a maximum size of n characters.

Definition at line 1714 of file info.c.

References vcdinfo_strip_trail().

Referenced by vcdinf_get_album_id(), vcdinfo_get_volumeset_id(), and vcdinfo_strip_trail().

{
  static char buf[1024];
  int j;

  vcd_assert (n < 1024);

  strncpy (buf, str, n);
  buf[n] = '\0';

  for (j = strlen (buf) - 1; j >= 0; j--)
    {
      if (buf[j] != ' ')
        break;

      buf[j] = '\0';
    }

  return buf;
}


Generated by  Doxygen 1.6.0   Back to index