if (*p == '/'){
  char *a = str;
  ++p;
  while (*p != '/' && *p != '\n' && *p != '\0')
    *a++ = *p++;
  *a = '\0';
}
どうだ?