projects
/
selector.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
adeac87
)
Fixed the error message of sage_malloc to stderr.
author
Francois Fleuret
<francois@fleuret.org>
Thu, 11 Aug 2011 22:35:33 +0000
(
00:35
+0200)
committer
Francois Fleuret
<francois@fleuret.org>
Thu, 11 Aug 2011 22:35:33 +0000
(
00:35
+0200)
selector.c
patch
|
blob
|
history
diff --git
a/selector.c
b/selector.c
index
9b88799
..
4746d01
100644
(file)
--- a/
selector.c
+++ b/
selector.c
@@
-77,7
+77,8
@@
int attr_modeline, attr_focus_line, attr_error;
void *safe_malloc(size_t n) {
void *p = malloc(n);
if (!p && n != 0) {
void *safe_malloc(size_t n) {
void *p = malloc(n);
if (!p && n != 0) {
- printf("Can not allocate memory: %s\n", strerror(errno));
+ fprintf(stderr,
+ "selector: can not allocate memory: %s\n", strerror(errno));
exit(EXIT_FAILURE);
}
return p;
exit(EXIT_FAILURE);
}
return p;
@@
-791,7
+792,7
@@
void read_file(struct hash_table_t *hash_table,
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE);
}
- while(*nb_lines < nb_lines_max &&
(fgets(raw_line, BUFFER_SIZE, file)
)) {
+ while(*nb_lines < nb_lines_max &&
fgets(raw_line, BUFFER_SIZE, file
)) {
for(s = raw_line + strlen(raw_line) - 1; s > raw_line && *s == '\n'; s--) {
*s = '\0';
}
for(s = raw_line + strlen(raw_line) - 1; s > raw_line && *s == '\n'; s--) {
*s = '\0';
}