aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/string/str/strdup.c2
-rw-r--r--src/string/strn/strndup.c2
-rw-r--r--src/unistd/searchpath3.c1
3 files changed, 3 insertions, 2 deletions
diff --git a/src/string/str/strdup.c b/src/string/str/strdup.c
index 6670ee9..9b428b4 100644
--- a/src/string/str/strdup.c
+++ b/src/string/str/strdup.c
@@ -34,7 +34,7 @@
char* strdup(const char* string)
{
size_t n = strlen(string) + 1;
- char* r = malloc(n * sizeof(char));
+ char* r = aligned_alloc(1, n * sizeof(char));
return r == NULL ? NULL : memcpy(r, string, n * sizeof(char));
}
diff --git a/src/string/strn/strndup.c b/src/string/strn/strndup.c
index 7d6e565..5dc17e0 100644
--- a/src/string/strn/strndup.c
+++ b/src/string/strn/strndup.c
@@ -39,7 +39,7 @@
char* strndup(const char* string, size_t maxlen)
{
size_t n = strnlen(string, maxlen) + 1;
- char* r = malloc(n * sizeof(char));
+ char* r = aligned_alloc(1, n * sizeof(char));
return r == NULL ? NULL : memcpy(r, string, n * sizeof(char));
}
diff --git a/src/unistd/searchpath3.c b/src/unistd/searchpath3.c
index 19ee3ee..6f018c7 100644
--- a/src/unistd/searchpath3.c
+++ b/src/unistd/searchpath3.c
@@ -15,6 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>