← Back to context

Comment by Panzerschrek

2 days ago

This doesn't look good:

  c8 buf [SP_PATH_MAX] = sp_zero;
  sp_cstr_copy_to_n(path, len, buf, SP_PATH_MAX);

since

  #define SP_PATH_MAX 4096

There should be a fallback for very long paths.

I'm inclined to agree with you that paths can be arbitrarily long as a matter of principle. However in practice I believe PATH_MAX on most distros defaults to 4096 so if you're going to insist on a hard upper limit it's at least within reason.