diff --git a/common/array.h b/common/array.h index edca49c3..2e8ffcd7 100644 --- a/common/array.h +++ b/common/array.h @@ -1,6 +1,7 @@ /* * array.h - useful array handling header * + * Copyright © 2009 Julien Danjou * Copyright © 2008 Pierre Habouzit * * This program is free software; you can redistribute it and/or modify @@ -32,7 +33,7 @@ #define foreach(var, array) \ for(typeof((array).tab) var = (array).tab; \ - var < (array).tab + (array).len; \ + var >= (array).tab && var < (array).tab + (array).len; \ var++) #define ARRAY_FUNCS(type_t, pfx, dtor) \