Revision: 75441
http://sourceforge.net/p/brlcad/code/75441
Author: starseeker
Date: 2020-04-17 18:42:25 +0000 (Fri, 17 Apr 2020)
Log Message:
-----------
Ah, - copy the implementation, not the parent container struct.
Modified Paths:
--------------
brlcad/branches/dm-fb-merge/src/libdm/fb_generic.c
Modified: brlcad/branches/dm-fb-merge/src/libdm/fb_generic.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/fb_generic.c 2020-04-17 18:15:00 UTC
(rev 75440)
+++ brlcad/branches/dm-fb-merge/src/libdm/fb_generic.c 2020-04-17 18:42:25 UTC
(rev 75441)
@@ -107,7 +107,6 @@
while (_if_list[i] != FB_NULL) {
if (bu_strncmp(interface_type, _if_list[i]->i->if_name+5,
strlen(interface_type)) == 0) {
/* found it, copy its struct in */
- *ifp = *(_if_list[i]);
*ifp->i = *(_if_list[i]->i);
return;
} else {
@@ -152,8 +151,8 @@
struct fb *
fb_open_existing(const char *file, int width, int height, struct
fb_platform_specific *fb_p)
{
- struct fb *ifp = (struct fb *)calloc(sizeof(struct fb), 1);
- if (!ifp) return NULL;
+ struct fb *ifp;
+ ifp = (struct fb *)calloc(sizeof(struct fb), 1);
ifp->i = (struct fb_impl *) calloc(sizeof(struct fb_impl), 1);
fb_set_interface(ifp, file);
fb_set_magic(ifp, FB_MAGIC);
@@ -409,6 +408,7 @@
if ((file = (const char *)getenv("FB_FILE")) == NULL || *file == '\0') {
/* None set, use first device as default */
*ifp = *(_if_list[0]); /* struct copy */
+ *ifp->i = *(_if_list[0]->i); /* struct copy */
file = ifp->i->if_name;
goto found_interface;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits