summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-29 17:34:45 -0400
committerEamon Walsh <ewalsh@tycho.nsa.gov>2011-07-29 18:44:13 -0400
commit0d9160851607fc30117797d7f1d2795ab02ae877 (patch)
treea8833fb5f118da69ab8358c039da2107877b38d7 /src
parent6fa3b61fdfeb3cbbe89808cb76bb96f5f1279a3d (diff)
Fixes for buffer_lookup() function.
Diffstat (limited to 'src')
-rw-r--r--src/buffer.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/buffer.c b/src/buffer.c
index 48dbdca..e9ecadc 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -74,14 +74,15 @@ buffer_free(struct buffer *b)
}
struct buffer *
-lookup_buffer(int domid, int buf_id)
+buffer_lookup(int domid, int buf_id)
{
struct client *c = client_lookup(domid);
struct buffer *b;
- LIST_FOREACH(b, &c->buffers, client_next)
- if (b->id == buf_id)
- return b;
+ if (c)
+ LIST_FOREACH(b, &c->buffers, client_next)
+ if (b->id == buf_id)
+ return b;
return NULL;
}