No need for a temporary variable in streplace()

This commit is contained in:
sin 2014-04-17 17:15:36 +01:00
parent edc39cef27
commit 87cb818ac0
1 changed files with 3 additions and 5 deletions

View File

@ -10,11 +10,9 @@
static void
streplace(char *s, int a, int b)
{
char *p;
for (p = s; *p; p++)
if (*p == a)
*p = b;
for (; *s; s++)
if (*s == a)
*s = b;
}
static int