Browse Source

Fix to make it compile on 64 bit size integers.

mingodad 13 years ago
parent
commit
e5911c71d8
1 changed files with 2 additions and 1 deletions
  1. 2 1
      squirrel/lua-regex.c

+ 2 - 1
squirrel/lua-regex.c

@@ -29,6 +29,7 @@ http://code.google.com/p/lua-regex-standalone/
 #include <string.h>
 #include <stdlib.h>
 #include <ctype.h>
+#include <inttypes.h>
 
 #include "lua-regex.h"
 
@@ -520,7 +521,7 @@ static int add_value (LuaMatchState *ms, char_buffer_st **b, const char *s,
             }
             if (cl == CAP_POSITION){
                 char buf[32];
-                snprintf(buf, sizeof(buf), "%d", ms->capture[il].init - ms->src_init + 1);
+                snprintf(buf, sizeof(buf), PRIdPTR, ms->capture[il].init - ms->src_init + 1);
                 if(!char_buffer_add_str(ms, b, buf, strlen(buf))) return 0;
             }
             else