Public feed #528471

Someone

public text v1 · immutable
Raw Edit
·published 2007-06-01 15:53 UTC
rendered paste body
// crashes - repz cmpsb %es:(%edi),%ds:(%esi)

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <netdb.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <sys/types.h>

#define PORT 80
#define MAXDATASIZE 100

int main(int argc, char *argv[]){
        char mylink[100], mydomain[100];
        int i, c = 0;

        if(argc < 2){
        printf("usage: ./rss-get feed-url\n");
        exit(1);
        }

        strcpy(mylink, argv[1]);
        strcpy(mydomain, argv[1]);

        for( i = 0; i <= 2 ; c++){
                if (i == 0){
                        if (strcmp(mydomain[c], ".") == 0) i++;
                }
                if (i == 1){
                        if (strcmp(mydomain[c], "/") == 0) i++;
                }
                if (i == 2){
                        mydomain[c] = '\0';
                        i++;
                }
        }

        printf("Domain: %s\n", mydomain);
        printf("Feed URL: %s\n", mylink);

} // MAIN