Lines Matching refs:obuff
38 int format_str(size_t iBytes, const char *ibuff, size_t ibuff_siz, char *obuff,
47 (obuff == NULL) && (obuff_siz == 0)) {
52 if ((ibuff == NULL) || (obuff == NULL) || (iBytes < 1))
55 memset(obuff, 0, obuff_siz);
57 strncat(obuff, buff, (obuff_siz - 1) - strlen(obuff));
60 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
62 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
64 strncat(obuff, buff, (obuff_siz - 1) - strlen(obuff));
68 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
70 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
71 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
73 strncat(obuff, " ", (obuff_siz - 1) - strlen(obuff));
77 strncat(obuff, buff, (obuff_siz - 1) - strlen(obuff));
83 int format_raw(size_t iBytes, const char *ibuff, char *obuff, size_t obuff_siz)
90 (obuff == NULL) && (obuff_siz == 0)) {
95 if ((ibuff == NULL) || (obuff == NULL) || (iBytes < 1))
98 memset(obuff, 0, obuff_siz);
100 strncat(obuff, buff, (obuff_siz - 1) - strlen(obuff));
103 strncat(obuff, buff, (obuff_siz - 1) - strlen(obuff));
113 char *ibuff, *obuff, *buff_curr;
138 if ((obuff = (char *)ALLOC(obuff_siz)) == NULL) {
140 fprintf(stderr, "Can't allocate obuff\n");
157 format_str(NumBytes, ibuff, ibuff_siz, obuff,
159 fprintf(stream, "%s\n", obuff);
162 format_raw(NumBytes, ibuff, obuff, obuff_siz);
163 fprintf(stream, "%s\n", obuff);
167 FREE(obuff);
172 FREE(obuff);