aboutsummaryrefslogtreecommitdiff
path: root/src/z_pack.c
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2003-05-16 11:26:06 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2003-05-16 11:26:06 +0000
commita5e2d2fa3abe68c1f9546f8b3c91415b96bce625 (patch)
tree442699c55eddf2751d607e829427c680e8df3ab8 /src/z_pack.c
parent45639747ce72dfd6b90551379a7b696ec8228e46 (diff)
fixed a bug in [packel] (for 0 length lists, and for indeces that were beyond the list-length)
svn path=/trunk/externals/zexy/; revision=621
Diffstat (limited to 'src/z_pack.c')
-rw-r--r--src/z_pack.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/z_pack.c b/src/z_pack.c
index 22a74eb..8e1f8a1 100644
--- a/src/z_pack.c
+++ b/src/z_pack.c
@@ -276,8 +276,12 @@ static void packel_list(t_packel *x, t_symbol *s, int argc, t_atom *argv)
t_atom *current;
int pos = (mypos < 0)?(argc+mypos):(mypos-1);
- if (pos < 0) pos = 0;
- else if (pos >= argc) pos = argc - 1;
+ if(argc==0){
+ if (pos==0||pos==-1)outlet_bang(x->x_obj.ob_outlet);
+ return;
+ }
+
+ if (pos < 0 || pos >= argc)return;
current = &(argv[pos]);