If you face an error like:
patching file xx
Assertion failed: (s && size), function savebuf, file /SourceCache/gpatch/gpatch-3/patch/util.c, line 424.
Abort trap: 6
Because the version of GNU Patch that bundles Mac OS is 6 years old, it has some bugs that were solved later. To fix it you just have to: