summaryrefslogtreecommitdiff
path: root/recordmydesktop/src
diff options
context:
space:
mode:
authorbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-17 11:55:10 +0000
committerbiocrasher <biocrasher@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2006-07-17 11:55:10 +0000
commit485c81f8613e0aa0e7b8d5a5d63ac6264e4a7786 (patch)
tree2ff79e6c0d0ac726e414dd791cf3df86ac66e01d /recordmydesktop/src
parent19ab47788fcbc5068b1d9e13d14b4a1d646e790d (diff)
segfault on big filenames fixed
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@21 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src')
-rw-r--r--recordmydesktop/src/parseargs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/recordmydesktop/src/parseargs.c b/recordmydesktop/src/parseargs.c
index 500b778..8125972 100644
--- a/recordmydesktop/src/parseargs.c
+++ b/recordmydesktop/src/parseargs.c
@@ -79,7 +79,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
if(argc==2){
if(argv[1][0]!='-'){
- realloc(arg_return->filename,strlen(argv[1])+1);
+ free(arg_return->filename);
+ arg_return->filename=malloc(strlen(argv[1])+1);
strcpy(arg_return->filename,argv[1]);
return 0;
}
@@ -131,7 +132,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
}
else if(!strcmp(argv[i],"-display")){
if(i+1<argc){
- realloc(arg_return->display,strlen(argv[i+1])+1);
+ free(arg_return->display);
+ arg_return->display=malloc(strlen(argv[i+1])+1);
strcpy(arg_return->display,argv[i+1]);
}
else{
@@ -206,7 +208,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
}
else if(!strcmp(argv[i],"-o")){
if(i+1<argc){
- realloc(arg_return->filename,strlen(argv[i+1])+1);
+ free(arg_return->filename);
+ arg_return->filename=malloc(strlen(argv[i+1])+1);
strcpy(arg_return->filename,argv[i+1]);
}
else{
@@ -366,7 +369,8 @@ int ParseArgs(int argc,char **argv,ProgArgs *arg_return){
}
else if(!strcmp(argv[i],"-device")){
if(i+1<argc){
- realloc(arg_return->device,strlen(argv[i+1])+1);
+ free(arg_return->device);
+ arg_return->device=malloc(strlen(argv[i+1])+1);
strcpy(arg_return->device,argv[i+1]);
}
else{
© All Rights Reserved