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
Sonar still does not like #undef. Use a local variable to hide _xbt_log_cat_init.
[simgrid.git]
/
src
/
xbt
/
xbt_os_file.c
diff --git
a/src/xbt/xbt_os_file.c
b/src/xbt/xbt_os_file.c
index
789c141
..
692b7c3
100644
(file)
--- a/
src/xbt/xbt_os_file.c
+++ b/
src/xbt/xbt_os_file.c
@@
-1,6
+1,6
@@
/* xbt_os_file.c -- portable interface to file-related functions */
/* xbt_os_file.c -- portable interface to file-related functions */
-/* Copyright (c) 2007-2010, 2012-201
5
. The SimGrid Team.
+/* Copyright (c) 2007-2010, 2012-201
7
. The SimGrid Team.
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
* All rights reserved. */
/* This program is free software; you can redistribute it and/or modify it
@@
-53,7
+53,9
@@
ssize_t xbt_getline(char **buf, size_t *n, FILE *stream)
}
(*buf)[i] = ch;
i++;
}
(*buf)[i] = ch;
i++;
- } while (ch != '\n' && (ch = getc(stream)) != EOF);
+ if (ch == '\n')
+ break;
+ } while ((ch = getc(stream)) != EOF);
if (i == *n) {
*n += 1;
if (i == *n) {
*n += 1;