A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
damn!
[simgrid.git]
/
src
/
xbt
/
xbt_log_appender_file.c
diff --git
a/src/xbt/xbt_log_appender_file.c
b/src/xbt/xbt_log_appender_file.c
index
d06d9b9
..
82f8141
100644
(file)
--- a/
src/xbt/xbt_log_appender_file.c
+++ b/
src/xbt/xbt_log_appender_file.c
@@
-7,9
+7,9
@@
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
* under the terms of the license (GNU LGPL) which comes with this package. */
#include "xbt/sysdep.h"
-#include "xbt/log_private.h"
+#include "
src/
xbt/log_private.h"
#ifdef HAVE_SMPI
#ifdef HAVE_SMPI
-#include "smpi/private.h" // to access bench_begin/end. Not ultraclean, I confess
+#include "s
rc/s
mpi/private.h" // to access bench_begin/end. Not ultraclean, I confess
#endif
#include <stdio.h>
#endif
#include <stdio.h>
@@
-105,7
+105,7
@@
static void append2_file(xbt_log_appender_t this_, char *str) {
fputs(str, d->file);
if(d->count<0){
fputs(APPEND2_END_TOKEN,d->file);
fputs(str, d->file);
if(d->count<0){
fputs(APPEND2_END_TOKEN,d->file);
- fseek(d->file,-
strlen(APPEND2_END_TOKEN
),SEEK_CUR);
+ fseek(d->file,-
((signed long)strlen(APPEND2_END_TOKEN)
),SEEK_CUR);
}
}
}
}
@@
-138,7
+138,10
@@
xbt_log_appender_t xbt_log_appender2_file_new(char *arg,int roll) {
xbt_assert(sep>0);
data->filename=xbt_strdup(sep+1);
*sep='\0';
xbt_assert(sep>0);
data->filename=xbt_strdup(sep+1);
*sep='\0';
- data->limit=atol(buf);
+ char *endptr;
+ data->limit=strtol(buf,&endptr,10);
+ xbt_assert(endptr[0]=='\0', "Invalid buffer size: %s", buf);
+ xbt_free(buf);
if(roll)
data->count=-1;
else
if(roll)
data->count=-1;
else