/* Returns: the same pointer passed in as @string  */
gchar* g_strreverse(gchar *string)
/* Returns: the same pointer passed in as @string  */
gchar* g_strreverse(gchar *string)
{
  g_return_val_if_fail (string != NULL, NULL);
  if (*string)
    {
      gchar *h, *t;
      h = string;
      t = string + strlen (string) - 1;
      while (h < t)
        {
          gchar c;
          c = *h;
          *h = *t;
          h++;
          *t = c;
          t--;
        }
    }
  return string;
}