Skip to content

Instantly share code, notes, and snippets.

@kovyrin
Created September 13, 2008 17:18
Show Gist options
  • Save kovyrin/10622 to your computer and use it in GitHub Desktop.
Save kovyrin/10622 to your computer and use it in GitHub Desktop.
--- constraints_parser.c (revision 59)
+++ constraints_parser.c (working copy)
@@ -230,8 +230,9 @@
len = offs += field->fixed_length;
}
resolved:
+ offs &= 0xffff;
if (rec + offs - page > UNIV_PAGE_SIZE) {
- if (debug) printf("Invalid offset for field %li: %li\n", i, offs);
+ if (debug) printf("Invalid offset for field %lu: %lu\n", i, offs);
return FALSE;
}
rec_offs_base(offsets)[i + 1] = len;
@@ -264,8 +265,9 @@
offs |= REC_OFFS_SQL_NULL;
}
+ offs &= 0xffff;
if (rec + offs - page > UNIV_PAGE_SIZE) {
- if (debug) printf("Invalid offset for field %li: %li\n", i, offs);
+ if (debug) printf("Invalid offset for field %lu: %lu\n", i, offs);
return FALSE;
}
@@ -287,8 +289,9 @@
offs |= REC_OFFS_EXTERNAL;
}
+ offs &= 0xffff;
if (rec + offs - page > UNIV_PAGE_SIZE) {
- if (debug) printf("Invalid offset for field %li: %li\n", i, offs);
+ if (debug) printf("Invalid offset for field %lu: %lu\n", i, offs);
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment