User`s manual

Firmware Interface
3-12 Single Board Computers SCSI Software UserÕs Manual
3
NOTES
A max_size of 32 bytes should be adequate for all available data. If you must
be sure, however, allocate space for string_buffer after determining the
space available. The following shows how one might accomplish this:
In the preceding example, note that if a null-terminated string is desired, it is
up to the Application to provide enough space and insert the terminating Ô\0Õ.
int avail_size;
char *string_buffer;
avail_size = sfw_getrev(NULL, 0);
string_buffer = malloc(avail_size + 1);
if (string_buffer != NULL) {
(void) sfw_getrev(string_buffer, avail_size);
string_buffer[avail_size] = ’\0’;
}