Skip to content
This repository has been archived by the owner on Apr 5, 2021. It is now read-only.

Commit

Permalink
ENCONTRE LA CAUSA DEL BUG DEL SEGFAULT!!! :D :D
Browse files Browse the repository at this point in the history
Siiiii finalmente!!! Al fin solucioné (!) esto!

[Condescendiente] La causa del bug es que el programador que
introdujo la variable t se olvidó de pedir memoria para la misma.
Ahora yo lo solucioné con unas llamadas a malloc(3) y memset(3)
que vi en un foro.

Este bugfix es importante y debería hacerse merge de 2.1 hacia
2.x.
  • Loading branch information
Lowercases committed Dec 10, 2011
1 parent ef1724e commit 4a032d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xteban.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define URL_VIDEO "http://www.youtube.com/watch?v=wC22UvgdKC8\n"
Expand Down Expand Up @@ -30,6 +31,9 @@ main() {
if (r != strlen(URL_VIDEO))
return 1;

t = malloc(sizeof(int));
memset(t, 0, sizeof(int));

return *t;

}
Expand Down

0 comments on commit 4a032d4

Please sign in to comment.