|
|
| version 1.3, 2025/03/09 19:50:47 | version 1.5, 2025/03/24 04:13:11 |
|---|---|
| Line 24 | Line 24 |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | * $Log$ |
| * Revision 1.5 2025/03/24 04:13:11 snw | |
| * Replace action macro dat with fra_dat to avoid symbol conflict on OS/2 | |
| * | |
| * Revision 1.4 2025/03/22 18:43:54 snw | |
| * Make STRLEN 255 chars and add BIGSTR macro for larger buffers | |
| * | |
| * Revision 1.3 2025/03/09 19:50:47 snw | * Revision 1.3 2025/03/09 19:50:47 snw |
| * Second phase of REUSE compliance and header reformat | * Second phase of REUSE compliance and header reformat |
| * | * |
| Line 47 void ssvn_zprocess (short action, char * | Line 53 void ssvn_zprocess (short action, char * |
| char *kbuf = (char *) malloc (STRLEN * sizeof(char)); | char *kbuf = (char *) malloc (STRLEN * sizeof(char)); |
| char *verb = (char *) malloc (STRLEN * sizeof(char)); | char *verb = (char *) malloc (STRLEN * sizeof(char)); |
| char *proc_path = (char *) malloc (STRLEN * sizeof(char)); | char *proc_path = (char *) malloc (PATHLEN * sizeof(char)); |
| pid_t t_pid; | pid_t t_pid; |
| Line 71 void ssvn_zprocess (short action, char * | Line 77 void ssvn_zprocess (short action, char * |
| } | } |
| t_pid = atol(ref->subscripts[0]); | t_pid = atol(ref->subscripts[0]); |
| snprintf (proc_path, STRLEN - 1, "/proc/%d", t_pid); | snprintf (proc_path, PATHLEN, "/proc/%d", t_pid); |
| strncpy (verb, ref->subscripts[1], STRLEN - 1); | strncpy (verb, ref->subscripts[1], STRLEN); |
| stcpy (kbuf, key); | stcpy (kbuf, key); |
| Line 85 void ssvn_zprocess (short action, char * | Line 91 void ssvn_zprocess (short action, char * |
| if (strcmp (verb, "EXISTS") == 0) { | if (strcmp (verb, "EXISTS") == 0) { |
| if (kill (t_pid, 0) == 0) { | if (kill (t_pid, 0) == 0) { |
| snprintf (data, STRLEN - 1, "%d\201", 1); | snprintf (data, STRLEN, "%d\201", 1); |
| } | } |
| else { | else { |
| snprintf (data, STRLEN - 1, "%d\201", 0); | snprintf (data, STRLEN, "%d\201", 0); |
| } | } |
| free (kbuf); | free (kbuf); |
| Line 102 void ssvn_zprocess (short action, char * | Line 108 void ssvn_zprocess (short action, char * |
| } | } |
| else if (strcmp (verb, "ATTRIBUTE") == 0) { | else if (strcmp (verb, "ATTRIBUTE") == 0) { |
| char attrib[256]; | char attrib[STRLEN]; |
| char fpath[4096]; | char fpath[PATHLEN]; |
| FILE *fp; | FILE *fp; |
| strncpy (attrib, ref->subscripts[2], 255); | strncpy (attrib, ref->subscripts[2], 255); |
| snprintf (fpath, 4095, "/proc/%d/%s", t_pid, attrib); | snprintf (fpath, PATHLEN, "/proc/%d/%s", t_pid, attrib); |
| if ((fp = fopen (fpath, "r")) == NULL) { | if ((fp = fopen (fpath, "r")) == NULL) { |
| Line 122 void ssvn_zprocess (short action, char * | Line 128 void ssvn_zprocess (short action, char * |
| return; | return; |
| } | } |
| fgets (data, 256, fp); | fgets (data, STRLEN, fp); |
| stcnv_c2m (data); | stcnv_c2m (data); |
| fclose (fp); | fclose (fp); |
| Line 194 void ssvn_zprocess (short action, char * | Line 200 void ssvn_zprocess (short action, char * |
| merr_raise (OK); | merr_raise (OK); |
| return; | return; |
| case dat: | case fra_dat: |
| case fra_order: | case fra_order: |
| case fra_query: | case fra_query: |
| case bigquery: | case bigquery: |