Permalink
Browse files

Fix channel_history stuff not to segfault (and do minor cleanup)

  • Loading branch information...
1 parent c78a1bb commit ee660c1df69539a37727a675293bfc602c71e172 @Vagabond committed Nov 17, 2010
Showing with 7 additions and 14 deletions.
  1. +4 −2 src/channel_history.c
  2. +3 −12 src/raw.c
View
@@ -121,8 +121,10 @@ CHANNEL_HISTORY_DEQUE *init_channel_history(CHANNEL *chan, apeconfig *config) {
/* preconditions: memory for raw has been allocated and will not be freed later elsewhere, maxsize>0 */
void push_raw_to_channel_history(CHANNEL *chan, RAW *raw, apeconfig *config) {
- if (chan == NULL || chan->history == NULL) return;
-
+ if (chan == NULL || chan->history == NULL) {
+ return;
+ }
+
if (chan->history->filter != NULL) {
char *type = strstr(raw->data, "\"raw\":\"");
View
@@ -122,14 +122,9 @@ void post_raw(RAW *raw, USERS *user, acetables *g_ape)
{
subuser *sub = user->subuser;
- if (sub != NULL) {
- post_raw_sub(raw, sub, g_ape);
- sub = sub->next;
-
- while (sub != NULL) {
- post_raw_sub(copy_raw_z(raw), sub, g_ape);
- sub = sub->next;
- }
+ while (sub != NULL) {
+ post_raw_sub(copy_raw_z(raw), sub, g_ape);
+ sub = sub->next;
}
}
@@ -141,10 +136,6 @@ void post_raw_restricted(RAW *raw, USERS *user, subuser *sub, acetables *g_ape)
if (sub == NULL) {
return;
}
- if (sub != tSub) {
- post_raw_sub(raw, tSub, g_ape);
- }
- tSub = tSub->next;
while (tSub != NULL) {
if (sub != tSub) {

0 comments on commit ee660c1

Please sign in to comment.