[hackers] [ubase] str* is in the reserved namespace, rename to replacestr() || sin

From: <git_AT_suckless.org>
Date: Tue, 06 May 2014 14:40:40 +0200

commit 5322e83da0f32f1d6805a2c3f492cfd3c178d489
Author: sin <sin_AT_2f30.org>
Date: Tue May 6 13:36:49 2014 +0100

    str* is in the reserved namespace, rename to replacestr()

diff --git a/sysctl.c b/sysctl.c
index a43a333..4aea23c 100644
--- a/sysctl.c
+++ b/sysctl.c
_AT_@ -8,7 +8,7 @@
 #include "util.h"
 
 static void
-streplace(char *s, int a, int b)
+replacestr(char *s, int a, int b)
 {
         for (; *s; s++)
                 if (*s == a)
_AT_@ -25,15 +25,15 @@ getsysctl(char *variable, char **value)
         ssize_t n;
         size_t sz, i;
 
- streplace(variable, '.', '/');
+ replacestr(variable, '.', '/');
 
         strlcpy(path, "/proc/sys/", sizeof(path));
         if (strlcat(path, variable, sizeof(path)) >= sizeof(path)) {
- streplace(variable, '/', '.');
+ replacestr(variable, '/', '.');
                 return -1;
         }
 
- streplace(variable, '/', '.');
+ replacestr(variable, '/', '.');
 
         fd = open(path, O_RDONLY);
         if (fd < 0)
_AT_@ -83,15 +83,15 @@ setsysctl(char *variable, char *value)
         int fd;
         ssize_t n;
 
- streplace(variable, '.', '/');
+ replacestr(variable, '.', '/');
 
         strlcpy(path, "/proc/sys/", sizeof(path));
         if (strlcat(path, variable, sizeof(path)) >= sizeof(path)) {
- streplace(variable, '/', '.');
+ replacestr(variable, '/', '.');
                 return -1;
         }
 
- streplace(variable, '/', '.');
+ replacestr(variable, '/', '.');
 
         fd = open(path, O_WRONLY);
         if (fd < 0)
Received on Tue May 06 2014 - 14:40:40 CEST

This archive was generated by hypermail 2.3.0 : Tue May 06 2014 - 14:48:07 CEST