Applied patch from Dean Armstrong to fix gr_repeat (ticket:246).
[debian/gnuradio] / gnuradio-core / src / lib / general / gr_map_bb.cc
index 891ff02ce393b16f6113f9f20327a1b9a59db7a5..b10dfea36abd3b5740cfcff4919520cd7ee6215f 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2006 Free Software Foundation, Inc.
+ * Copyright 2006,2007 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -16,8 +16,8 @@
  * 
  * You should have received a copy of the GNU General Public License
  * along with GNU Radio; see the file COPYING.  If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * the Free Software Foundation, Inc., 51 Franklin Street,
+ * Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -41,7 +41,7 @@ gr_map_bb::gr_map_bb (const std::vector<int> &map)
   for (int i = 0; i < 0x100; i++)
     d_map[i] = i;
 
-  unsigned int size = std::max((size_t) 0x100, map.size());
+  unsigned int size = std::min((size_t) 0x100, map.size());
   for (unsigned int i = 0; i < size; i++)
     d_map[i] = map[i];
 }