--- src/nvidia_os.c.orig 2011-05-16 23:34:03.000000000 -0700 +++ src/nvidia_os.c 2011-06-26 15:50:20.000000000 -0700 @@ -320,6 +320,6 @@ nvidia_work_t *work; status = os_alloc_mem((void **)&work, sizeof(nvidia_work_t)); - if (status != status) + if (status != RM_OK) return status; @@ -406,8 +404,10 @@ l = strlen(nv_error_string); if (ap != NULL) vsnprintf(nv_error_string + l, MAX_ERROR_STRING - l, fmt, ap); - else - snprintf(nv_error_string + l, MAX_ERROR_STRING - l, fmt); + else { + strncpy(nv_error_string + l, fmt, MAX_ERROR_STRING - l - 1); + nv_error_string[MAX_ERROR_STRING - 1] = '\0'; + } printf("%s", nv_error_string); }