~ubuntu-branches/ubuntu/trusty/lua5.1/trusty-security

« back to all changes in this revision

Viewing changes to src/lstrlib.c

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Tassi
  • Date: 2011-07-20 12:42:45 UTC
  • Revision ID: james.westby@ubuntu.com-20110720124245-m8u2bohaibil16a7
Tags: 5.1.4-7
Fixed dh_installdocs target for dpkg-buildpackage -B

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
 
2
** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
3
3
** Standard library for string operations and pattern-matching
4
4
** See Copyright Notice in lua.h
5
5
*/
754
754
 
755
755
 
756
756
static int str_format (lua_State *L) {
 
757
  int top = lua_gettop(L);
757
758
  int arg = 1;
758
759
  size_t sfl;
759
760
  const char *strfrmt = luaL_checklstring(L, arg, &sfl);
768
769
    else { /* format item */
769
770
      char form[MAX_FORMAT];  /* to store the format (`%...') */
770
771
      char buff[MAX_ITEM];  /* to store the formatted item */
771
 
      arg++;
 
772
      if (++arg > top)
 
773
        luaL_argerror(L, arg, "no value");
772
774
      strfrmt = scanformat(L, strfrmt, form);
773
775
      switch (*strfrmt++) {
774
776
        case 'c': {