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

libtre users, please help me

Name: Anonymous 2009-08-12 9:10

Hi /prog/raiders, did you ever use libtre? If so can you tell me what's wrong with my code? It segfaults at row 37


 18 #define REMATCH 3
 19
 20 int main(int argc, char **argv)
 21 {
 22     assert(argc > 1);
 23     regex_t re;
 24     regmatch_t pmatch[REMATCH];
 25     const char *str = argv[1];
 26     const char regex[] = "^\\.text\\.(.*)$";
 27     int ret;
 28     printf("Regex: %s\n", regex);
 29
 30     if ((ret = regcomp(&re, regex, REG_EXTENDED)) != 0) {
 31         printf("FAIL! %d\n", ret);
 32         exit(EXIT_FAILURE);
 33     } else {
 34         printf("Compile ok, %d\n", ret);
 35     }
 36
 37     if (regexec(&re, str, REMATCH, pmatch, 0) == 0) {
 38         printf("SUCCESS!\n");
 39     }
 40     printf("LOL\n");
 41
 42     regfree(&re);
 43     exit(EXIT_SUCCESS);
 44 }

Name: Anonymous 2009-08-12 12:34

man regexec

Name: Anonymous 2009-08-12 14:00

row 37
Yeah, but what column?

Name: Anonymous 2009-08-12 19:16

It's because you format your code like a monstrous faggot. Redo that shit and your segfault will disappear.

Name: Anonymous 2009-08-12 19:28

>>4
There are too many redundant braces there, but there's absolutely nothing wrong with K&R style. Go back to writing echo for ANONUX.

Name: Anonymous 2009-08-12 21:03

>>5
I think ONANIX is a more fitting name, mockery wise, for the shitty project you're refering to, kind sir.

Name: Anonymous 2010-12-09 4:29

Name: Anonymous 2011-02-02 23:52

Name: Anonymous 2011-11-24 11:51

>>11
nice doubles bro

Name: Anonymous 2011-11-24 13:52

>>10
Bro, thanks bro; I'm proud of them and my mom is too.

Name: Anonymous 2011-11-24 23:14

If it ain't Lisp, it's crap.

Name: Anonymous 2011-11-25 11:15

>>12
Lisp is shit.

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