      subroutine getargs(m, args, n)
      character*(*) args(m)
      if (m.le.0) then
        n = 0
      else
        n = iargc() + 1
        if (n.gt.m) n = m
        do 1 i=1,n
          call getarg(i-1, args(i))
    1   continue
      endif
      return
      end
