Skip to content
  • This project
    • Loading...
  • Sign in

Barry / rf-depot

Go to a project
Toggle navigation
Toggle navigation pinning
  • Projects
  • Groups
  • Snippets
  • Help
  • Project
  • Activity
  • Repository
  • Graphs
  • Network
  • Create a new issue
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Network
  • Compare
  • Branches
  • Tags
Switch branch/tag
  • rf-depot
  • ..
  • sa
  • memcmp.c
  • root's avatar
    added the rest · 5fa3b884
    5fa3b884
    root committed 2020-05-02 06:11:47 +0000
memcmp.c 318 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
#include <PR/os.h>
#include "common.h"

/*
 * Extra stdlib function not supplied by libultra
 */

int memcmp(const void *s1, const void *s2, size_t n)
{
    const u8* a = s1, * b = s2;
    u8 a1, b1;
    while (n-- > 0) {
        if ((a1 = *a++) == (b1 = *b++)) continue;
        return a1 - b1;
    }
    return 0;
}