mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 00:56:14 +00:00
Get nyancat nyanning in Serenity.
I found a cute program that renders an animated nyancat in the terminal. This patch adds enough hackery to get it working correctly. :^)
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <AK/Types.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -60,6 +61,15 @@ char* strdup(const char* str)
|
||||
return new_str;
|
||||
}
|
||||
|
||||
char* strndup(const char* str, size_t maxlen)
|
||||
{
|
||||
size_t len = min(strlen(str), maxlen);
|
||||
char* new_str = (char*)malloc(len + 1);
|
||||
memcpy(new_str, str, len);
|
||||
new_str[len] = 0;
|
||||
return new_str;
|
||||
}
|
||||
|
||||
int strcmp(const char* s1, const char* s2)
|
||||
{
|
||||
while (*s1 == *s2++)
|
||||
|
||||
Reference in New Issue
Block a user