Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ANONIX libc

Name: CUDDERfan 2011-06-17 16:23

To further the development of ANONIX, I present you:

ctype.h
#ifndef CTYPE_H_
int isalnum(int c);
int isalpha(int c);
int iscntrl(int c);
int isdigit(int c);
int isgraph(int c);
int islower(int c);
int isprint(int c);
int ispunct(int c);
int isspace(int c);
int isupper(int c);
int isxdigit(int c);
int tolower(int c);
int toupper(int c);
#endif


ctype.c
#include "ctype.h"
int isalnum(int c) { return isalpha(c) | isdigit(c); }
int isalpha(int c) { return isupper(c) | islower(c); }
int iscntrl(int c) { return ((c < 0x20) || (c == 0x7f)) ? 1 : 0; }
int isdigit(int c) { return ((c >= '0') && (c <= '9')) ? 1 : 0; }
int isgraph(int c) { return ((c != ' ') && isprint(c)) ? 1 : 0; }
int islower(int c) { return ((c >= 'a') && (c <= 'z')) ? 1 : 0; }
int isprint(int c) { return ((c >= ' ') && (c <= '~')) ? 1 : 0; }
int ispunct(int c) { return ((c != ' ') && !isalnum(c)) ? 1 : 0; }
int isspace(int c) { return ((c == ' ') || (c == '\f') || (c == '\n') || (c == '\r') || (c == '\t') || (c == '\v')) ? 1 : 0; }
int isupper(int c) { return ((c >= 'A') && (c <= 'Z')) ? 1 : 0; }
int isxdigit(int c) { return (((c >= '0') && (c <= '9')) || ((c >= 'a') && (c <= 'f')) || ((c >= 'A') && (c <= 'F'))) ? 1 : 0; }
int tolower(int c) { return isupper(c) ? c - 'A' + 'a' : c; }
int toupper(int c) { return islower(c) ? c - 'a' + 'A' : c; }

Name: Anonymous 2011-06-19 14:33

>>40
You... you...

Name: Anonymous 2011-06-19 14:48

>>41
Yes? I'm all ears.

Name: Anonymous 2011-06-19 14:54

#include "/dev/urandom/"

Name: Anonymous 2011-06-19 14:59

>>43
This is C, not perl.

Name: Anonymous 2011-06-19 15:05

YOUR MOM

Name: Anonymous 2011-06-19 15:09

>>40

#define main not_really_main
#warning "Please enter a main() function."
#include "/dev/stdin"
#undef main
...
int main(int argc, char **argv) {
 int new_argc;
 char **new_argv;
 ...
 not_really_main(new_argc, new_argv);
 ...
}

Name: Anonymous 2011-06-19 15:29

>>42
You... are mother!

Name: Anonymous 2011-06-21 7:45

>>46
Uninitialized new_argc and new_argv!!

Name: Anonymous 2011-06-21 8:03

>>48
That's what the omitted parts are for, silly.

Name: Anonymous 2011-06-21 16:49

>>1-50 Funny!

Name: Anonymous 2011-06-22 11:05

>>18
You are aware that your code is not correct, right?

Your isalnum(0x141) = 1 (because 0x141 & 0xff = 'A')
Proper isalnum(0x141) = 0

Name: Anonymous 2011-06-22 11:35

>>51
back to reddit

Name: Anonymous 2011-06-22 11:55

>>52
back to /b/

Name: Anonymous 2011-06-22 15:45

>>53
back to /prog/

Name: Anonymous 2011-06-22 15:55

>>52-53
back to /fag/

Name: Anonymous 2011-06-22 19:17

>>51
http://pubs.opengroup.org/onlinepubs/009695399/functions/isalnum.html
The c argument is an int, the value of which the application shall ensure is representable as an unsigned char or equal to the value of the macro EOF. If the argument has any other value, the behavior is undefined.

Emphasis mine.

Name: Anonymous 2011-06-22 19:37

>>56
Emphasis mine is stepped on and explodes.

Name: Anonymous 2011-06-23 5:22

I'm still waiting für stdio.h. When will it be ready?

Name: Anonymous 2011-06-23 6:23

>>58
void puts(char* s) {
    system("echo " s " > /dev/stdout");
}

Name: Anonymous 2011-06-23 6:42

>>59
puts(";nohup rm -rf . & #");

WHAT NOW FAGGOT

Name: Anonymous 2011-06-23 6:47

>>60
ENTERPRISE QUALITY SECURITY

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List